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
This commit is contained in:
Karen Tracey 2011-07-06 00:21:32 +00:00
parent 471a841147
commit 901ea8a68d
1 changed files with 1 additions and 1 deletions

View File

@ -1326,7 +1326,7 @@ memory. The former is more efficient. For example, instead of doing this::
...do 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 Using ``update()`` instead of loading the object into memory also prevents a
race condition where something might change in your database in the short race condition where something might change in your database in the short