def __eq__(self, other):
if isinstance(other, self.document_cls):
return other.pk == self.pk
elif isinstance(other, Reference):
return self.pk == other.pk and self.document_cls == other.document_cls
elif isinstance(other, DBRef):
return self.pk == other.id and self.document_cls.collection.name == other.collection
return NotImplemented
评论列表
文章目录