summaryrefslogtreecommitdiff
path: root/django/db/models/sql
diff options
context:
space:
mode:
authorMalcolm Tredinnick <malcolm.tredinnick@gmail.com>2008-03-13 10:46:54 +0000
committerMalcolm Tredinnick <malcolm.tredinnick@gmail.com>2008-03-13 10:46:54 +0000
commit53634d4cdd45a0623cfb7b4a16c34ca7a6c9c223 (patch)
treed191b67f7368e2982b5c85c5f6e296087796270c /django/db/models/sql
parent9f0fb3dcc9d24ec1f5abb83dfb58b6da5a6d4baa (diff)
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
Diffstat (limited to 'django/db/models/sql')
-rw-r--r--django/db/models/sql/subqueries.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/django/db/models/sql/subqueries.py b/django/db/models/sql/subqueries.py
index 66f4bfdd8a..2594b9fcce 100644
--- a/django/db/models/sql/subqueries.py
+++ b/django/db/models/sql/subqueries.py
@@ -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).