{"id":13625811,"url":"https://github.com/saxix/django-concurrency","last_synced_at":"2025-05-14T14:06:21.541Z","repository":{"id":2771662,"uuid":"3770478","full_name":"saxix/django-concurrency","owner":"saxix","description":"Optimistic lock implementation for Django. Prevents users from doing concurrent editing.","archived":false,"fork":false,"pushed_at":"2025-04-03T17:35:40.000Z","size":1094,"stargazers_count":449,"open_issues_count":7,"forks_count":50,"subscribers_count":8,"default_branch":"develop","last_synced_at":"2025-04-13T21:33:14.421Z","etag":null,"topics":["concurrency","django","optimistic-locking"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/saxix.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGES","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":"AUTHORS","dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2012-03-20T01:05:04.000Z","updated_at":"2025-04-13T02:50:43.000Z","dependencies_parsed_at":"2022-08-06T12:31:21.807Z","dependency_job_id":"530db00f-9b99-4990-8bc3-f895ff972148","html_url":"https://github.com/saxix/django-concurrency","commit_stats":{"total_commits":546,"total_committers":25,"mean_commits":21.84,"dds":0.08791208791208793,"last_synced_commit":"fba78f11dce75aab381e60a0e0ab8a175d51b604"},"previous_names":[],"tags_count":41,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saxix%2Fdjango-concurrency","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saxix%2Fdjango-concurrency/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saxix%2Fdjango-concurrency/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saxix%2Fdjango-concurrency/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/saxix","download_url":"https://codeload.github.com/saxix/django-concurrency/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254159176,"owners_count":22024558,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["concurrency","django","optimistic-locking"],"created_at":"2024-08-01T21:02:02.518Z","updated_at":"2025-05-14T14:06:21.492Z","avatar_url":"https://github.com/saxix.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"Django Concurrency\n==================\n\n\n[![Pypi](https://badge.fury.io/py/django-concurrency.svg)](https://badge.fury.io/py/django-concurrency)\n[![coverage](https://codecov.io/github/saxix/django-concurrency/coverage.svg?branch=develop)](https://codecov.io/github/saxix/django-concurrency?branch=develop)\n[![Test](https://github.com/saxix/django-concurrency/actions/workflows/tests.yaml/badge.svg)](https://github.com/saxix/django-concurrency/actions/workflows/tests.yaml)\n[![Docs](https://readthedocs.org/projects/django-concurrency/badge/?version=stable)](http://django-concurrency.readthedocs.io/en/stable/)\n[![Django](https://img.shields.io/pypi/frameworkversions/django/django-concurrency)](https://pypi.org/project/django-concurrency/)\n[![Supported Python versions](https://img.shields.io/pypi/pyversions/django-concurrency.svg)](https://pypi.org/project/django-concurrency/)\n\n\ndjango-concurrency is an [optimistic lock][1] implementation for Django.\n\nIt prevents users from doing concurrent editing in Django both from UI and from a\ndjango command.\n\n\nHow it works\n------------\n\n```python\n\nfrom django.db import models\nfrom concurrency.fields import IntegerVersionField\n\nclass ConcurrentModel( models.Model ):\n    version = IntegerVersionField( )\n    name = models.CharField(max_length=100)\n```\n\nNow if you try::\n\n```python\n\na = ConcurrentModel.objects.get(pk=1)\na.name = '1'\n\nb = ConcurrentModel.objects.get(pk=1)\nb.name = '2'\n\na.save()\nb.save()\n\n```\n\nyou will get a ``RecordModifiedError`` on ``b.save()``\n\n\nSimilar projects\n----------------\n\nOther projects that handle concurrent editing are [django-optimistic-lock][10]\nand [django-locking][11] anyway concurrency is \"a batteries included\" optimistic\nlock management system, here some features not available elsewhere:\n\n * can be applied to any model; not only your code (ie. django.contrib.auth.Group)\n * handle [list-editable][2] ChangeList. (handle `#11313 \u003chttps://code.djangoproject.com/ticket/11313\u003e`_)\n * manage concurrency conflicts in admin's actions\n * can intercept changes performend out of the django app (ie using pgAdmin, phpMyAdmin, Toads) (using [TriggerVersionField][6])\n * can be disabled if needed (see [disable_concurrency][3])\n * [ConditionalVersionField][4] to handle complex business rules\n\n\n\nProject Links\n------------\n\n- Code: https://github.com/saxix/django-concurrency\n- Documentation: https://django-concurrency.readthedocs.org/en/latest/\n- Issue Tracker: https://github.com/saxix/django-concurrency/issues\n- Download Package: http://pypi.python.org/pypi/django-concurrency/\n\n\n[10]:https://github.com/gavinwahl/django-optimistic-lock\n[11]:https://github.com/stdbrouw/django-locking\n[1]:http://en.wikipedia.org/wiki/Optimistic_concurrency_control\n[2]:https://django-concurrency.readthedocs.org/en/latest/admin.html#list-editable\n[3]:https://django-concurrency.readthedocs.org/en/latest/api.html?#disable-concurrency\n[4]:https://django-concurrency.readthedocs.org/en/latest/fields.html#conditionalversionfield\n[6]:https://django-concurrency.readthedocs.org/en/latest/fields.html#triggerversionfield\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsaxix%2Fdjango-concurrency","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsaxix%2Fdjango-concurrency","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsaxix%2Fdjango-concurrency/lists"}