summaryrefslogtreecommitdiff
path: root/django/db/models/base.py
diff options
context:
space:
mode:
authorMalcolm Tredinnick <malcolm.tredinnick@gmail.com>2009-03-10 05:24:19 +0000
committerMalcolm Tredinnick <malcolm.tredinnick@gmail.com>2009-03-10 05:24:19 +0000
commit0516c5d9214372810dcf7d02f3a0f2705bb25a86 (patch)
tree6b7f70d8fbe532862959079632a9c3da5e857f8d /django/db/models/base.py
parentec9c03ce0bef5ecd40179e813f2ae6b87f3be8c4 (diff)
Fixed #10443 -- Fixed model attribute updating after r10003.
Adding a get_db_prep_save() call to the UpdateQuery code path meant it was being called twice if you updated an existing model attribute. This change removes that double call and also makes TimeField.to_python() a little more robust for the benefit of the Oracle backend (just in case). git-svn-id: http://code.djangoproject.com/svn/django/trunk@10013 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'django/db/models/base.py')
-rw-r--r--django/db/models/base.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/django/db/models/base.py b/django/db/models/base.py
index c02ca04b1e..62ebbab7f0 100644
--- a/django/db/models/base.py
+++ b/django/db/models/base.py
@@ -376,7 +376,7 @@ class Model(object):
manager.filter(pk=pk_val).extra(select={'a': 1}).values('a').order_by())):
# It does already exist, so do an UPDATE.
if force_update or non_pks:
- values = [(f, None, f.get_db_prep_save(raw and getattr(self, f.attname) or f.pre_save(self, False))) for f in non_pks]
+ values = [(f, None, (raw and getattr(self, f.attname) or f.pre_save(self, False))) for f in non_pks]
rows = manager.filter(pk=pk_val)._update(values)
if force_update and not rows:
raise DatabaseError("Forced update did not affect any rows.")