MCPcopy Index your code
hub / github.com/MongoEngine/mongoengine / __eq__

Method __eq__

mongoengine/base/document.py:291–304  ·  view source on GitHub ↗
(self, other)

Source from the content-addressed store, hash-verified

289 return "%s object" % self.__class__.__name__
290
291 def __eq__(self, other):
292 if (
293 isinstance(other, self.__class__)
294 and hasattr(other, "id")
295 and other.id is not None
296 ):
297 return self.id == other.id
298 if isinstance(other, DBRef):
299 return (
300 self._get_collection_name() == other.collection and self.id == other.id
301 )
302 if self.id is None:
303 return self is other
304 return False
305
306 def __ne__(self, other):
307 return not self.__eq__(other)

Callers 1

__ne__Method · 0.95

Calls 1

_get_collection_nameMethod · 0.95

Tested by

no test coverage detected