Author: adrian
Date: 2011-07-05 13:16:08 -0700 (Tue, 05 Jul 2011)
New Revision: 16517

Modified:
   django/trunk/docs/ref/models/querysets.txt
Log:
Added another bit to the update() queryset docs about avoiding race conditions

Modified: django/trunk/docs/ref/models/querysets.txt
===================================================================
--- django/trunk/docs/ref/models/querysets.txt  2011-07-05 20:09:00 UTC (rev 
16516)
+++ django/trunk/docs/ref/models/querysets.txt  2011-07-05 20:16:08 UTC (rev 
16517)
@@ -1328,6 +1328,10 @@
 
     Entry.objects.get(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
+period of time between loading the object and calling ``save()``.
+
 Finally, note that the ``update()`` method does an update at the SQL level and,
 thus, does not call any ``save()`` methods on your models, nor does it emit the
 ``pre_save`` or ``post_save`` signals (which are a consequence of calling

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.

Reply via email to