summaryrefslogtreecommitdiff
path: root/django/db/models/sql
diff options
context:
space:
mode:
authorMalcolm Tredinnick <malcolm.tredinnick@gmail.com>2008-02-23 00:23:57 +0000
committerMalcolm Tredinnick <malcolm.tredinnick@gmail.com>2008-02-23 00:23:57 +0000
commite2f524ca09bacef4545b56dc3f136655fa0b912c (patch)
tree72d1ed487931a53fcb6505247e798c2d64449a2d /django/db/models/sql
parente2b3c50cf0445ff6d9c4c707f59ce64038d0fbb0 (diff)
queryset-refactor: Fixed the case of calling update() on a model manager.
git-svn-id: http://code.djangoproject.com/svn/django/branches/queryset-refactor@7146 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'django/db/models/sql')
-rw-r--r--django/db/models/sql/query.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/django/db/models/sql/query.py b/django/db/models/sql/query.py
index fba4a088f0..20dcb4b71d 100644
--- a/django/db/models/sql/query.py
+++ b/django/db/models/sql/query.py
@@ -1240,7 +1240,8 @@ class UpdateQuery(Query):
values.append('%s = NULL' % qn(name))
result.append(', '.join(values))
where, params = self.where.as_sql()
- result.append('WHERE %s' % where)
+ if where:
+ result.append('WHERE %s' % where)
return ' '.join(result), tuple(update_params + params)
def clear_related(self, related_field, pk_list):