« Previous | Next » 

Revision ea1e5d9f


Added by Giorgos Korfiatis about 11 years ago

Make ForUpdateManager thread-safe

The manager held a global flag `_for_update' on a single manager object,
which could be read or set by multiple threads.

select_for_update() is now provided by a subclass of QuerySet.
It must be used as the last modifier of a query set,
e.g. Project.objects.filter(state=1).select_for_update(),
and cannot be combined with operators provided by other subclasses,
such as values_list().

Since get() returns an element rather than a query set,
the manager also provides a specific function get_for_update().


  • added
  • modified
  • copied
  • renamed
  • deleted

View differences