@classmethod
def from_document(cls, amostra_client, document):
    """
        Convert a dict returned by the server to our traitlets-based object.
        """
    contents = {}
    for sample_uuid, location in document['contents'].items():
        sample = amostra_client.samples.find_one({'uuid': sample_uuid})
        contents[sample] = location
    document['contents'] = contents
    return super().from_document(amostra_client, document)
