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:
parent
471a841147
commit
901ea8a68d
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue