diff options
| author | Adrian Holovaty <adrian@holovaty.com> | 2010-01-10 17:53:19 +0000 |
|---|---|---|
| committer | Adrian Holovaty <adrian@holovaty.com> | 2010-01-10 17:53:19 +0000 |
| commit | cf1b6845d4cc1c34cfa975f6ba98b7fb966cb491 (patch) | |
| tree | 4eb5b119cec9f7adc485bccafc78981545e9fa33 /django | |
| parent | 0683a79d0c5582d9c7f4aa424713adbfba37bfac (diff) | |
Fixed #12142 -- EmptyQuerySet.update() no longer updates all rows in the database
git-svn-id: http://code.djangoproject.com/svn/django/trunk@12171 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'django')
| -rw-r--r-- | django/db/models/query.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/django/db/models/query.py b/django/db/models/query.py index 4e3326a9ca..365df96fb0 100644 --- a/django/db/models/query.py +++ b/django/db/models/query.py @@ -1089,6 +1089,12 @@ class EmptyQuerySet(QuerySet): """ return self + def update(self, **kwargs): + """ + Don't update anything. + """ + return 0 + # EmptyQuerySet is always an empty result in where-clauses (and similar # situations). value_annotation = False |
