Skip to main content

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

Project description

https://pypip.in/v/django-concurrency/badge.png https://pypip.in/d/django-concurrency/badge.png

django-concurrency is an optimistic lock [1] implementation for Django.

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

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 and 1.5

  • 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_

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django-concurrency-0.8.1.tar.gz (20.8 kB view details)

Uploaded Source

File details

Details for the file django-concurrency-0.8.1.tar.gz.

File metadata

File hashes

Hashes for django-concurrency-0.8.1.tar.gz
Algorithm Hash digest
SHA256 57a0d7b7ae6f11be5a658f17c43ad55835f9e045e0a6339f28de8299e7995a9c
MD5 9fa374629e6791ae4c1cab3492efe8e2
BLAKE2b-256 4072987c835af2cc77d7f7e50d3ab0df17d05f4527ead8ecc2e87f1d06d12e0b

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page