Registry / web-framework / django-admin-sortable

django-admin-sortable

JSON →
library2.3pypypiunverified

A Django library that provides drag-and-drop sorting for models and inline models in the Django admin interface. Version 2.3 is the latest stable release, but the project appears to be in maintenance mode with infrequent updates.

pip install django-admin-sortable
INSTALL
IMPORT
SIG · DJANGO-ADMIN-SORTA
D
django-admin-sortable
web-frameworkpythonv2.3
Install
4.5s avg
Import
Disk
67MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v2.3 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.000s · 68.3MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 4.5s · import 0.000s · 69MB
67MB installed
● package 67MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

SortableAdminMixin
from adminsortable.admin import SortableAdminMixin
from adminsortable.admin import SortableAdminMixin
SortableTabularInline
from adminsortable.admin import SortableTabularInline
SortableStackedInline
from adminsortable.admin import SortableStackedInline

Basic setup: add app, define Sortable model, use SortableAdminMixin in admin, and reorder data.

# settings.py INSTALLED_APPS = [ ... 'adminsortable', ] # models.py from django.db import models from adminsortable.models import Sortable class Category(Sortable): name = models.CharField(max_length=100) class Meta(Sortable.Meta): pass def __str__(self): return self.name # admin.py from django.contrib import admin from adminsortable.admin import SortableAdminMixin from .models import Category class CategoryAdmin(SortableAdminMixin, admin.ModelAdmin): list_display = ('name', 'my_order') admin.site.register(Category, CategoryAdmin) # After migrating, run: python manage.py reorder <app_label> <model_name>
Debug
Known issues
breakingSortable model must inherit from Sortable (not SortableMixin) and set Meta as shown. Failing to include Sortable.Meta will cause errors like 'No order field found'.
fix
Ensure model inherits from `adminsortable.models.Sortable` and includes `class Meta(Sortable.Meta): pass`
affects: all
deprecatedThis library is not actively maintained. It may not work with Django 3.x+ due to admin template changes. Consider alternatives like django-admin-sortable2 (django-admin-sortable2).
fix
Switch to django-admin-sortable2 for better Django 3+/4+ support.
affects: 2.3 and earlier
gotchaInline sorting (SortableTabularInline, SortableStackedInline) often fails if the parent model is not also sortable. Inline sort order may not save correctly.
fix
Ensure parent model uses Sortable mixin or admin uses SortableAdminMixin.
affects: all
Upgrade
Version history
2.3latest on PyPI · released Dec 22, 2021
Audit
Dependencies
DjangorequiredRequired: works with Django 1.11+ but best with 2.2 LTS or earlier; Django 3.x+ may have issues.
Agent activity
4 hits · last 30 days
node
3
Resources
django-admin-sortable — pip install django-admin-sortable · libregistry