• Stars
    star
    414
  • Rank 104,550 (Top 3 %)
  • Language
    Python
  • License
    MIT License
  • Created over 12 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Optimistic lock implementation for Django. Prevents users from doing concurrent editing.

Django Concurrency

Pypi coverage Test Docs

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

More Repositories

1

django-adminactions

collection of useful django actions to use with ModelAdmin or AdminSite.
Python
680
star
2

django-admin-extra-buttons

Python
133
star
3

django-iadmin

WARNING: This project is not maintained anymore.
JavaScript
42
star
4

django-adminfilters

Python
39
star
5

django-geo

django application to manage administrative geographical info (country, city, region ...)
Python
27
star
6

django-webcam

UNMAINTAINED: this project is not currently active. no plan to restart it soon
Python
25
star
7

django-admin-extra-urls

Single mixin class to easily add buttons on any Django ModelAdmin related page
Python
25
star
8

django-site-maintenance

django app to put web site in 'maintenance mode'
Python
21
star
9

drf-api-checker

DjangoRestFramework contract integrity checker
Python
20
star
10

django-strategy-field

Strategy Pattern with Django models
Python
15
star
11

django-workflows

fork of bitbucket project
Python
7
star
12

django-smart-admin

Python
5
star
13

django-uuid-pk

django uuidfield that can be used as primary key
Python
5
star
14

django-whatsnew

Simple application to manage "what's new" welcome screen based on package version.
Python
5
star
15

django-nojs

simple application to manage "javascript disabled" browser
5
star
16

django-buildhost

fabric scripts to create a totally OS independend Apache/python/Django stack
Python
5
star
17

django-extra-fields

additional django fields
Python
4
star
18

django-easy-reports

Python
4
star
19

django-regex

Fields and utilities to work with regular expression in Django
Python
3
star
20

stefanoapostolico.com

HTML
3
star
21

devpi-theme-16

devpi custom theme
CSS
3
star
22

pyppi

Python
3
star
23

lazo

small utility to interact with Rancher API
Python
2
star
24

pdfcli

simple command line tool to work with pdf
Python
2
star
25

django-sysinfo

Simple django app to expose system infos: libraries version, database server version...
Python
2
star
26

drf-querystringfilter

DjangoRestFramework Filter based on URL querystring arguments
Python
2
star
27

django-excel-data-sync

Python
1
star
28

django-anonymoususer-permissions

Small backend to grant permission to Anonymous users using django admin interface
Python
1
star
29

docker-flower

Smarty
1
star
30

django-project-settings

Store django settings into database
Python
1
star
31

drf-dynamic-serializer

Python
1
star
32

django-mb

Django app to send updates/creations/deletions to a message broker.
Python
1
star
33

django-ichangelist

Python
1
star
34

flower_oauth_azure

Azure OAUth Login Handler
Python
1
star
35

flex-registration

Python
1
star