From e2f524ca09bacef4545b56dc3f136655fa0b912c Mon Sep 17 00:00:00 2001 From: Malcolm Tredinnick Date: Sat, 23 Feb 2008 00:23:57 +0000 Subject: 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 --- tests/modeltests/update/models.py | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'tests') diff --git a/tests/modeltests/update/models.py b/tests/modeltests/update/models.py index 55b30cd3f5..3b0f83389f 100644 --- a/tests/modeltests/update/models.py +++ b/tests/modeltests/update/models.py @@ -56,5 +56,12 @@ Multiple fields can be updated at once >>> d.value, d.another_value (u'fruit', u'peaches') +In the rare case you want to update every instance of a model, update() is also +a manager method. + +>>> DataPoint.objects.update(value='thing') +>>> DataPoint.objects.values('value').distinct() +[{'value': u'thing'}] + """ } -- cgit v1.3