Giter Club home page Giter Club logo

django-concurrency's Introduction

Django Concurrency

django-concurrency is an optimistic lock1 implementation for Django.

Supported Django versions: 1.8.x, 1.9.x, 1.10.x., 1.11.x

It prevents users from doing concurrent editing in Django both from UI and from a django command.

How it works

sample code:

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)
  • 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
Stable master-build master-cov
Development dev-build dev-cov
Project home page: https://github.co m/saxix/django- concurrency
Issue tracker: https://github.co m/saxix/django- concurrency/issues?sort
Download: http://pypi.pytho n.org/pypi/djan go-concurrency/
Documentation: https://django-co ncurrency.readt hedocs.org/en/latest/

_list-editable: https://django-concurrency.readthedocs.org/en/latest/admin.html#list-editable

Join the chat at https://gitter.im/saxix/django-concurrency


  1. http://en.wikipedia.org/wiki/Optimistic_concurrency_controlโ†ฉ

django-concurrency's People

Contributors

saxix avatar requires avatar claytondaley avatar haos616 avatar ticosax avatar gitter-badger avatar tdruez avatar boscomw avatar domdinicola avatar mrc75 avatar naddiseo avatar richardasymmetric avatar charettes avatar

Watchers

James Cloos avatar Artur Barseghyan avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.