Skip to main content

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

Author

Colin Howe <colin@colinhowe.co.uk> http://www.colinhowe.co.uk - @colinhowe

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)

Source distribution for django-model-versions 0.4.0
File Size Uploaded
django-model-versions-0.4.0.tar.gz 3.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for django-model-versions 0.4.0
File Interpreter ABI Platform
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

Release history Release notifications | RSS feed

This release

0.4.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page