Ticket #3703: pk_property.patch
File pk_property.patch, 523 bytes (added by , 18 years ago) |
---|
-
django/db/models/base.py
77 77 def _get_pk_val(self): 78 78 return getattr(self, self._meta.pk.attname) 79 79 80 def _set_pk_val(self, value): 81 return setattr(self, self._meta.pk.attname, value) 82 83 pk = property(_get_pk_val, _set_pk_val) 84 80 85 def __repr__(self): 81 86 return '<%s: %s>' % (self.__class__.__name__, self) 82 87