#12247: update on empty queryset in which the update kwargs refer to inherited
columns update all rows of base table
---------------------------------------------------+------------------------
Reporter: jsmullyan | Owner: matiasb
Status: assigned | Milestone: 1.2
Component: Database layer (models, ORM) | Version: 1.1
Resolution: | Keywords:
Stage: Accepted | Has_patch: 1
Needs_docs: 0 | Needs_tests: 0
Needs_better_patch: 0 |
---------------------------------------------------+------------------------
Comment (by russellm):
@jkocherhans - add_filter(pk__in=[]) *is* a no-op (or rather, it raises
EmptyResultSet). The issue here is that the "if self.related_ids"
condition means that you *aren't* adding the [] filter, which means that
you are left with a default "update everything" filter. Changing the
condition to "if self.related_ids is None" means that the [] filter will
be added, and thereby shortcut the update into a no-op.
--
Ticket URL: <http://code.djangoproject.com/ticket/12247#comment:9>
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.