Skip to main content

Django Concurrency

Pypi coverage Test Docs Django Supported Python versions

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

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)

Source distribution for django-concurrency 2.8.1
File Size Uploaded
django_concurrency-2.8.1.tar.gz 21.1 kB Details

Built distribution (wheel)

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

Release history Release notifications | RSS feed

This release

2.8.1 This release

2 release files

2.8

2 release files

2.7

2 release files

2.6.0

2 release files

2.5

1 release file

2.4

2 release files

2.3

1 release file

2.2

1 release file

2.1.1

1 release file

2.0

2 release files

1.4

1 release file

1.3.2

1 release file

1.3.1

1 release file

1.3

1.2

1 release file

1.1

1 release file

1.0.1

1 release file

1.0

1 release file

0.9

1 release file

0.8.1

1 release file

0.8

1 release file

0.7.1

1 release file

0.7

1 release file

0.6

1 release file

0.5

1 release file

0.4

1 release file

0.3.2

1 release file

0.3.1

1 release file

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