              if (force_update or (not force_insert and
                      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]
                      rows = manager.filter(pk=pk_val)._update(values)
                      if force_update and not rows:
                          raise DatabaseError("Forced update did not affect any rows.")
              else:
                  record_exists = False
 
</s> remove }
 </s> add 
                    values = [(f, None, (raw and getattr(self, f.attname) or f.pre_save(self, False))) for f in non_pks]
              if (force_update or (not force_insert and
                      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, (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.")
              else:
                  record_exists = False
keep keep keep keep replace keep keep keep keep keep
 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 
django/db/models/base.py