1
0
mirror of https://github.com/django/django.git synced 2025-10-31 09:41:08 +00:00

Fixed #7298: prevent update() on sliced QuerySet since UPDATE doesn't reliably support LIMIT/OFFSET. Thanks, George Vilches.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@7601 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Jacob Kaplan-Moss
2008-06-09 16:17:54 +00:00
parent 12716794db
commit b5f92938ab
2 changed files with 11 additions and 0 deletions

View File

@@ -63,5 +63,12 @@ a manager method.
>>> DataPoint.objects.values('value').distinct()
[{'value': u'thing'}]
We do not support update on already sliced query sets.
>>> DataPoint.objects.all()[:2].update(another_value='another thing')
Traceback (most recent call last):
...
AssertionError: Cannot update a query once a slice has been taken.
"""
}