﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
13864	DatabaseError while saving with force_update set	fva	nobody	"Models:

{{{
class A ( models.Model ) :
    a = models.IntegerField ( null=True )

class B ( A ) : pass
}}}

session:

{{{
In [3]: b = B()

In [4]: b.save()

In [5]: b.save ( force_update = True )
---------------------------------------------------------------------------
DatabaseError                             Traceback (most recent call last)

<ipython console> in <module>()

django/db/models/base.pyc in save(self, force_insert, force_update, using)
    428         if force_insert and force_update:
    429             raise ValueError(""Cannot force both insert and updating in model saving."")
--> 430         self.save_base(using=using, force_insert=force_insert, force_update=force_update)
    431 
    432     save.alters_data = True

django/db/models/base.pyc in save_base(self, raw, cls, origin, force_insert, force_update, using)
    496                         rows = manager.using(using).filter(pk=pk_val)._update(values)
    497                         if force_update and not rows:
--> 498                             raise DatabaseError(""Forced update did not affect any rows."")
    499                 else:
    500                     record_exists = False

DatabaseError: Forced update did not affect any rows.
}}}

but simple b.save() updates fine.
"	Bug	closed	Database layer (models, ORM)	dev	Normal	fixed	force_update DatabaseError		Accepted	1	0	0	0	0	0
