Jens Ådne Rydland
unread,Nov 3, 2009, 7:42:19 AM11/3/09Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to django-d...@googlegroups.com
Came across an issue with EmptyQuerySet today, it seems it does not
behave correctly with regard to update(). (or that the documentation is
lacking, I suspect it's the former)
Assuming I have a model Foo of which I have say 42 stored instances in
the database, each with a CharacterField "bar".
If I do Foo.objects.none().count() I get the expected result 0.
However, Foo.objects.none().update(bar='baz') returns 42, and all 42
rows in the database have been updated.
This seems to be caused by EmptyQuerySet not overriding update(),
shouldn't this just return 0?
--
best regards, Jens Ådne Rydland