def document(self, view=None):
    '\n        :param view: document view to return.\n        :return: a :class:`UserDocument <yandeley.models.documents.UserDocument>` or\n                 :class:`CatalogDocument <yandeley.models.catalog.CatalogDocument>`, depending on which the document is\n                 attached to.\n        '
    if ('document_id' in self.json):
        return self.session.documents.get_lazy(self.json['document_id'], view=view)
    elif ('catalog_id' in self.json):
        return self.session.catalog.get_lazy(self.json['catalog_id'], view=view)
    else:
        return None
:param view: document view to return.
:return: a :class:`UserDocument <yandeley.models.documents.UserDocument>` or
         :class:`CatalogDocument <yandeley.models.catalog.CatalogDocument>`, depending on which the document is
         attached to.
def document(self, view=None):
    '\n        :param view: document view to return.\n        :return: a :class:`UserDocument <yandeley.models.documents.UserDocument>` or\n                 :class:`CatalogDocument <yandeley.models.catalog.CatalogDocument>`, depending on which the document is\n                 attached to.\n        '
    if ('document_id' in self.json):
        return self.session.documents.get_lazy(self.json['document_id'], view=view)
    elif ('catalog_id' in self.json):
        return self.session.catalog.get_lazy(self.json['catalog_id'], view=view)
    else:
        return None