Django Concurrency
django-concurrency is an optimistic lock implementation for Django.
It prevents users from doing concurrent editing in Django both from UI and from a django command.
How it works
from django.db import models
from concurrency.fields import IntegerVersionField
class ConcurrentModel( models.Model ):
version = IntegerVersionField( )
name = models.CharField(max_length=100)
Now if you try::
a = ConcurrentModel.objects.get(pk=1)
a.name = '1'
b = ConcurrentModel.objects.get(pk=1)
b.name = '2'
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)
- handle list-editable ChangeList. (handle
#11313 <https://code.djangoproject.com/ticket/11313>_) - manage concurrency conflicts in admin's actions
- can intercept changes performend out of the django app (ie using pgAdmin, phpMyAdmin, Toads) (using TriggerVersionField)
- can be disabled if needed (see disable_concurrency)
- ConditionalVersionField to handle complex business rules
Project Links
- Code: https://github.com/saxix/django-concurrency
- Documentation: https://django-concurrency.readthedocs.org/en/latest/
- Issue Tracker: https://github.com/saxix/django-concurrency/issues
- Download Package: http://pypi.python.org/pypi/django-concurrency/
Release files for django-concurrency 2.8.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| django_concurrency-2.8.1.tar.gz | 21.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| django_concurrency-2.8.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 49.0 kB
Release files / django_concurrency-2.8.1.tar.gz
| Download URL | django_concurrency-2.8.1.tar.gz |
|---|---|
| Size | 21.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
621817c0cf8b344d14389cdf7d9040080717292cde88ecbd471facb79614afbf
|
|
BLAKE2b-256 checksum How to use checksums |
915794ce0cb4592ff43f4e9671bc2e7fc4d50c1c7f71d56fe85a6637d7b58306
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.3
|
Release files / django_concurrency-2.8.1-py3-none-any.whl
| Download URL | django_concurrency-2.8.1-py3-none-any.whl |
|---|---|
| Size | 27.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
785e0c47052d47438cb99dc9ff128b8166c24377284080bdd7f3a57dbeb4c56a
|
|
BLAKE2b-256 checksum How to use checksums |
c4c7657936235e0176a27bd56d556ad9ab427bfdab0fe29c2447bc39510bf6d5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.3
|