MCPcopy
hub / github.com/django/django / __hash__

Method __hash__

django/db/models/base.py:648–651  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

646 return my_pk == other.pk
647
648 def __hash__(self):
649 if not self._is_pk_set():
650 raise TypeError("Model instances without primary key value are unhashable")
651 return hash(self.pk)
652
653 def __reduce__(self):
654 data = self.__getstate__()

Callers

nothing calls this directly

Calls 1

_is_pk_setMethod · 0.95

Tested by

no test coverage detected