From 901ea8a68d4aa064f2e72eeac5ca87968905673e Mon Sep 17 00:00:00 2001 From: Karen Tracey Date: Wed, 6 Jul 2011 00:21:32 +0000 Subject: [PATCH] s/get/filter in new example of how to use queryset update method: update won't work on a model instance. git-svn-id: http://code.djangoproject.com/svn/django/trunk@16518 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- docs/ref/models/querysets.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/ref/models/querysets.txt b/docs/ref/models/querysets.txt index aaf6a97a03..a1bd5ccb7b 100644 --- a/docs/ref/models/querysets.txt +++ b/docs/ref/models/querysets.txt @@ -1326,7 +1326,7 @@ memory. The former is more efficient. For example, instead of doing this:: ...do this:: - Entry.objects.get(id=10).update(comments_on=False) + Entry.objects.filter(id=10).update(comments_on=False) Using ``update()`` instead of loading the object into memory also prevents a race condition where something might change in your database in the short