Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Browse files

Changed save() code from [507] to work under sqlite. All test…

…s now pass in all 3 database backends.

git-svn-id: bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit c727729183bdf773df9b7ebe725fb7a57e7508a2 1 parent 7cfddb3
@adrianholovaty adrianholovaty authored
Showing with 1 addition and 1 deletion.
  1. +1 −1  django/core/meta/
2  django/core/meta/
@@ -735,7 +735,7 @@ def method_save(opts, self):
# Determine whether a record with the primary key already exists.
cursor.execute("SELECT 1 FROM %s WHERE %s=%%s LIMIT 1" % (opts.db_table,, [pk_val])
# If it does already exist, do an UPDATE.
- if cursor.rowcount > 0:
+ if cursor.fetchone():
db_values = [f.get_db_prep_save(f.pre_save(getattr(self,, False)) for f in non_pks]
cursor.execute("UPDATE %s SET %s WHERE %s=%%s" % (opts.db_table,
','.join(['%s=%%s' % for f in non_pks]),,

0 comments on commit c727729

Please sign in to comment.
Something went wrong with that request. Please try again.