Skip to content

reinbach/django-concurrency

 
 

Repository files navigation

Django Concurrency

image

image

django-concurrency is an optimistic lock1 implementation for Django.

Tested with: 1.4.x, 1.5.x, 1.6.x, 1.7.x 1.8.x.

It prevents users from doing concurrent editing in Django both from UI and from a django command.

How it works

sample code:

from concurrency.fields import IntegerVersionField

class ConcurrentModel( models.Model ):
    version = IntegerVersionField( )

Now if you try:

a = ConcurrentModel.objects.get(pk=1)
b = ConcurrentModel.objects.get(pk=1)
a.save()
b.save()

you will get a RecordModifiedError on b.save()

Similar projects

Other projects that handle concurrent editing are django-optimistic-lock and django-locking anyway concurrency is "a batteries included" optimistic lock management system, here some features not available elsewhere:

  • can be applied to any model; not only your code (ie. django.contrib.auth.Group)
  • works with django 1.4-1.8
  • handle list-editable ChangeList. (handle #11313)
  • manage concurrency conflicts in admin's actions
  • can intercept changes performend out of the django app (ie using pgAdmin, phpMyAdmin, Toads) (using TriggerVersionField_
Stable master-build master-cov Requirements Status
Development dev-build dev-cov Requirements Status
Project home page: https://github.co m/saxix/django- concurrency
Issue tracker: https://github.co m/saxix/django- concurrency/issues?sort
Download: http://pypi.pytho n.org/pypi/djan go-concurrency/
Documentation: https://django-co ncurrency.readt hedocs.org/en/latest/

_list-editable: https://django-concurrency.readthedocs.org/en/latest/admin.html#list-editable


  1. http://en.wikipedia.org/wiki/Optimistic_concurrency_control

About

Optimistic lock implementation for Django. Prevents users from doing concurrent editing.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 96.7%
  • HTML 2.0%
  • Makefile 1.3%