#13864: DatabaseError while saving with force_update set
---------------------------------------------------+------------------------
Reporter: fva | Owner: nobody
Status: reopened | Milestone:
Component: Database layer (models, ORM) | Version: SVN
Resolution: | Keywords:
force_update DatabaseError
Stage: Accepted | Has_patch: 1
Needs_docs: 0 | Needs_tests: 0
Needs_better_patch: 0 |
---------------------------------------------------+------------------------
Changes (by gregmuellegger):
* has_patch: 0 => 1
* version: 1.2 => SVN
* stage: Unreviewed => Accepted
Comment:
The problem is that the subclass has no custom fields assigned. So the
subclassed model will try to make an update query without and values this
results in an empty query.
There is a very simple fix for this, added in the second patch. This
avoids making the empty query that ofcourse doesn't affect any rows which
causes the error.
Maybe someone with a better understanding of the ORM could have a look if
this fix is sufficient and confirm that it doesn't have sideeffects to NOT
execute the update query if there is nothing to change.
--
Ticket URL: <http://code.djangoproject.com/ticket/13864#comment:4>
Django <http://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/django-updates?hl=en.