django-model-versions
A library for adding version information to models. This version information is then used to prevent concurrent modifications. E.g.
>>> b1 = Blog.objects.get(id=1) >>> b2 = Blog.objects.get(id=1) # Same row as b1 >>> b1.title = 'Some blog' >>> b1.save() >>> b2.title = 'Some other blog' >>> b2.save()
Will result in a ConcurrentModificationException being raised instead of overriding the data saved by b1.
Usage
Subclass modelversions.VersionedModel instead of django.db.models.Model. That’s it!
Known flaws
objects.update(…) will not increment the version number for objects altered. This would be better as a mixin. object.delete() will not check versioning Django admin hates it
Release files for django-model-versions 0.4.0
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-model-versions-0.4.0.tar.gz | 3.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| django-model-versions-0.4.0.linux-x86_64.tar.gz | Details |
Total release size: 9.0 kB
Release files / django-model-versions-0.4.0.tar.gz
| Download URL | django-model-versions-0.4.0.tar.gz |
|---|---|
| Size | 3.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
cd95c438e4e8f832fcab40f4a01496adf0659b51cd15c80fe47975ec94f05902
|
|
BLAKE2b-256 checksum How to use checksums |
36f618fec9b1511a0e8ff7bc685e6dfed3abacaff7f29364a2583a1ba33b22fb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / django-model-versions-0.4.0.linux-x86_64.tar.gz
| Download URL | django-model-versions-0.4.0.linux-x86_64.tar.gz |
|---|---|
| Size | 5.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
69764e828f0638d5e5482bdfa3089f1406b16ec01dd3add797083e8e703c7d84
|
|
BLAKE2b-256 checksum How to use checksums |
e5e32a1c328ee16dbf5c15573f37a8378959e7fa8b88b0c3ae1505b0cf85dbbc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |