Skip to content

MechanisM/django-concurrency

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Django Concurrency

image

django-concurrency is a optimistic locking library for Django 1.4. It works adding a VersionField to the model, each time a model is successfully saved the VersionNumber is incremented.

How it works

sample code:

from concurrency.fields import IntegerVersionField

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

Now if if you try:

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

you will get a RecordModifedError on b.save()

About

django optimistic locking management

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published