Skip to content

Prevents users from doing concurrent editing in Django. Works out of the box in the admin interface, or you can integrate it with your own apps using a public API.

License

Notifications You must be signed in to change notification settings

souen/django-locking

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

62 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

WARNING: WORK IN PROGRESS

About this fork

Far more intrusive, this fork aims to be lighter and to do less HTTP and DB requests: - Locking is no longer done through AJAX, it's done directly in admin.py - JavaScript vars are exported through a template tag, and not through a JS call to a dynamic view. - Views are included directly in LockableAdmin (through get_url()), there is no longer need for custom decorators (to perform permission checks) nor utils (to fetch lockable models...)

Installation

  • Add locking to your INSTALLED_APPS.
  • Specify settings #FIXME
  • Static files
  • For any model that requires locking:
    • Specify locking.models.LockableModel as a model base class.
    • Specify locking.admin.LockableAdmin as a ModelAdmin base class.
    • Specify locking.forms.LockableForm as a base class of the ModelAdmin.form.
    • Add original_locked_at and original_modified_at to ModelAdmin.fields.
  • Call {% locking_variables %} in the change_form.html (or in a parent), before any call to locking JS scripts.

About

Prevents users from doing concurrent editing in Django. Works out of the box in the admin interface, or you can integrate it with your own apps using a public API.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 81.9%
  • JavaScript 17.7%
  • Shell 0.4%