def dereference(self, session, ref, allow_none=False):
""" Dereference an ObjectID to this field's underlying type """
ref = DBRef(id=ref, collection=self.type.type.get_collection_name(),
database=self.db)
ref.type = self.type.type
return session.dereference(ref, allow_none=allow_none)
评论列表
文章目录