Skip to content

cnk/django-admin-sortable2

 
 

Repository files navigation

django-admin-sortable2

This Django package adds functionality for generic drag-and-drop ordering of items in the List, the Stacked- and the Tabular-Inlines Views of the Django Admin interface.

Build Status PyPI version Python versions Django versions Downloads Software license

Check the demo:

Demo

This library offers simple mixin classes which enrich the functionality of any existing class inheriting from admin.ModelAdmin, admin.StackedInline or admin.TabularInline.

It thus makes it very easy to integrate with existing models and their model admin interfaces. Existing models can inherit from models.Model or any other class derived thereof. No special base class is required.

Version 2.0

This is a major rewrite of this django-admin-sortable2. It replaces the client side part against Sortable.JS and thus the need for jQuery.

Replacing that library allowed me to add a new feature: Multiple items can now be dragged and dropped together.

CNK fork

I wanted to upgrade a project that uses this library to Django 5.2. I didn't have time to put in a proper PR to update so I forked and build at local distribution for this. I didn't make any code changes but needed to kludge the github actions to build this in a way that included Django 5.2 templates.

Note: to build this, I needed to manually install setuptools, wheel, and build. Then I could run the patch lines from .github/workflows/publish.yml and then build with python -m build --sdist --wheel --outdir dist/

Project's Home

https://github.com/jrief/django-admin-sortable2

Detailled documentation can be found on ReadTheDocs.

Before reporting bugs or asking questions, please read the contributor's guide.

License

Licensed under the terms of the MIT license.

Copyright © 2013-2022 Jacob Rief and contributors.

Please follow me on Twitter Follow for updates and other news.

About

Generic drag-and-drop ordering for objects in the Django admin interface; fork to add Django 5.2 support

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 85.3%
  • TypeScript 12.0%
  • CSS 1.6%
  • Other 1.1%