Optimistic lock implementation for Django. Prevents users from doing concurrent editing
Project description
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/
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file django_concurrency-2.7.tar.gz.
File metadata
- Download URL: django_concurrency-2.7.tar.gz
- Upload date:
- Size: 20.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
90b7091039920e759a6b6feb1d481d918f3d6105bd1e2bff09ab781c2734cff3
|
|
| MD5 |
bfddfbdafd7f7da8cd9a149e6bb630e1
|
|
| BLAKE2b-256 |
7db734f3f007ba189497bebb48eb543572f00cfdd40b86061baf8ca649a978d0
|
Provenance
The following attestation bundles were made for django_concurrency-2.7.tar.gz:
Publisher:
release.yml on saxix/django-concurrency
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
django_concurrency-2.7.tar.gz -
Subject digest:
90b7091039920e759a6b6feb1d481d918f3d6105bd1e2bff09ab781c2734cff3 - Sigstore transparency entry: 192039365
- Sigstore integration time:
-
Permalink:
saxix/django-concurrency@c4ae65dcf279d4a071ff63615417cea933f2e1fe -
Branch / Tag:
refs/tags/2.7 - Owner: https://github.com/saxix
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@c4ae65dcf279d4a071ff63615417cea933f2e1fe -
Trigger Event:
push
-
Statement type:
File details
Details for the file django_concurrency-2.7-py3-none-any.whl.
File metadata
- Download URL: django_concurrency-2.7-py3-none-any.whl
- Upload date:
- Size: 28.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3dfc1e7d1db436d578faf782c0027fac8296d34c175230ebcf91086c380ade88
|
|
| MD5 |
d44abebab1422539b28d952133c6b061
|
|
| BLAKE2b-256 |
4de97a332cef95a91598674994a6fda02ef88eee7d903af364444f15ddeab660
|
Provenance
The following attestation bundles were made for django_concurrency-2.7-py3-none-any.whl:
Publisher:
release.yml on saxix/django-concurrency
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
django_concurrency-2.7-py3-none-any.whl -
Subject digest:
3dfc1e7d1db436d578faf782c0027fac8296d34c175230ebcf91086c380ade88 - Sigstore transparency entry: 192039368
- Sigstore integration time:
-
Permalink:
saxix/django-concurrency@c4ae65dcf279d4a071ff63615417cea933f2e1fe -
Branch / Tag:
refs/tags/2.7 - Owner: https://github.com/saxix
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@c4ae65dcf279d4a071ff63615417cea933f2e1fe -
Trigger Event:
push
-
Statement type: