def dbref(self):
"""
Return a pymongo DBRef instance related to the document
"""
if not self.is_created:
raise NotCreatedError('Must create the document before'
' having access to DBRef')
return DBRef(collection=self.collection.name, id=self.pk)
评论列表
文章目录