diff options
| author | Malcolm Tredinnick <malcolm.tredinnick@gmail.com> | 2007-08-18 07:40:59 +0000 |
|---|---|---|
| committer | Malcolm Tredinnick <malcolm.tredinnick@gmail.com> | 2007-08-18 07:40:59 +0000 |
| commit | 6ed780d7964a526d332bbd5eedd233347231bf59 (patch) | |
| tree | fb33937283c9b062941c17a33b703c93b2a961ab | |
| parent | 8b115c7fb84449cbb9ecb4b543ee3f1265290910 (diff) | |
Fixed #5102 -- Fixed model saving so that 0 can be used as a primary key value. Thanks, oggie rob.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@5933 bcc190cf-cafb-0310-a4f2-bffc1f526a37
| -rw-r--r-- | django/db/models/base.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/django/db/models/base.py b/django/db/models/base.py index 8b021978ed..064dc8fdec 100644 --- a/django/db/models/base.py +++ b/django/db/models/base.py @@ -209,7 +209,7 @@ class Model(object): # First, try an UPDATE. If that doesn't update anything, do an INSERT. pk_val = self._get_pk_val() - pk_set = bool(pk_val) + pk_set = pk_val is not None record_exists = True if pk_set: # Determine whether a record with the primary key already exists. |
