db.models.Model.__hash__()

Model.__hash__() [source]

The __hash__() method is based on the instance’s primary key value. It is effectively hash(obj.pk). If the instance doesn’t have a primary key value then a TypeError will be raised (otherwise the __hash__() method would return different values before and after the instance is saved, but changing the __hash__() value of an instance is forbidden in Python.

doc_Django
2016-10-09 18:35:56
Comments
Leave a Comment

Please login to continue.