diff options
| author | Jacob Kaplan-Moss <jacob@jacobian.org> | 2008-06-09 16:17:54 +0000 |
|---|---|---|
| committer | Jacob Kaplan-Moss <jacob@jacobian.org> | 2008-06-09 16:17:54 +0000 |
| commit | b5f92938abd64f5577eea9f80925d71bc7968c09 (patch) | |
| tree | a36e648fcf2dc2dacb6e7ae6b3e63586750e3edb /tests | |
| parent | 12716794dbcf2e1bf7a07bd18dfc0ae24be4e6f8 (diff) | |
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
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/modeltests/update/models.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/modeltests/update/models.py b/tests/modeltests/update/models.py index 3b0f83389f..8a35b61a7c 100644 --- a/tests/modeltests/update/models.py +++ b/tests/modeltests/update/models.py @@ -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. + """ } |
