Ticket #2160: 0_pk.patch
File 0_pk.patch, 539 bytes (added by , 18 years ago) |
---|
-
django/db/models/base.py
167 167 168 168 # First, try an UPDATE. If that doesn't update anything, do an INSERT. 169 169 pk_val = self._get_pk_val() 170 pk_set = bool(pk_val) 170 pk_set = bool(pk_val) or pk_val == 0 171 171 record_exists = True 172 172 if pk_set: 173 173 # Determine whether a record with the primary key already exists.