Ticket #5102: zero_pk.diff

File zero_pk.diff, 630 bytes (added by oggie rob <oz.robharvey@…, 17 years ago)

One-liner diff to use "is not None" instead of "bool"

  • usr/local/djangolibs/django_trunk/django/db/models/base.py

     
    209209
    210210        # First, try an UPDATE. If that doesn't update anything, do an INSERT.
    211211        pk_val = self._get_pk_val()
    212         pk_set = bool(pk_val)
     212        pk_set = pk_val is not None
    213213        record_exists = True
    214214        if pk_set:
    215215            # Determine whether a record with the primary key already exists.
Back to Top