Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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
  • Loading branch information...
commit 53634d4cdd45a0623cfb7b4a16c34ca7a6c9c223 1 parent 9f0fb3d
Malcolm Tredinnick malcolmt authored
Showing with 3 additions and 1 deletion.
  1. +3 −1 django/db/models/sql/subqueries.py
4 django/db/models/sql/subqueries.py
View
@@ -159,7 +159,9 @@ def pre_sql_setup(self):
# 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).
Please sign in to comment.
Something went wrong with that request. Please try again.