1
0
mirror of https://github.com/django/django.git synced 2025-07-05 18:29:11 +00:00

queryset-refactor: Made sure that update filter queries only return a single

column. Fixed #6760.


git-svn-id: http://code.djangoproject.com/svn/django/branches/queryset-refactor@7234 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Malcolm Tredinnick 2008-03-13 10:46:54 +00:00
parent 9f0fb3dcc9
commit 53634d4cdd

View File

@ -159,7 +159,9 @@ class UpdateQuery(Query):
# from other tables.
query = self.clone(klass=Query)
query.bump_prefix()
self.add_fields([query.model._meta.pk.name])
query.select = []
query.extra_select = {}
query.add_fields([query.model._meta.pk.name])
# Now we adjust the current query: reset the where clause and get rid
# of all the tables we don't need (since they're in the sub-select).