{"id":23556,"library":"django-admin-sortable","title":"django-admin-sortable","description":"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.","status":"maintenance","version":"2.3","language":"python","source_language":"en","source_url":"https://github.com/iambrandontaylor/django-admin-sortable","tags":["django","admin","sortable","drag-and-drop","inline-sorting"],"install":[{"cmd":"pip install django-admin-sortable","lang":"bash","label":"PyPI install"}],"dependencies":[{"reason":"Required: works with Django 1.11+ but best with 2.2 LTS or earlier; Django 3.x+ may have issues.","package":"Django","optional":false}],"imports":[{"note":"Missing .admin submodule causes ImportError.","wrong":"from adminsortable import SortableAdminMixin","symbol":"SortableAdminMixin","correct":"from adminsortable.admin import SortableAdminMixin"},{"note":"","wrong":"","symbol":"SortableTabularInline","correct":"from adminsortable.admin import SortableTabularInline"},{"note":"","wrong":"","symbol":"SortableStackedInline","correct":"from adminsortable.admin import SortableStackedInline"}],"quickstart":{"code":"# settings.py\nINSTALLED_APPS = [\n    ...\n    'adminsortable',\n]\n\n# models.py\nfrom django.db import models\nfrom adminsortable.models import Sortable\n\nclass Category(Sortable):\n    name = models.CharField(max_length=100)\n\n    class Meta(Sortable.Meta):\n        pass\n\n    def __str__(self):\n        return self.name\n\n# admin.py\nfrom django.contrib import admin\nfrom adminsortable.admin import SortableAdminMixin\nfrom .models import Category\n\nclass CategoryAdmin(SortableAdminMixin, admin.ModelAdmin):\n    list_display = ('name', 'my_order')\n\nadmin.site.register(Category, CategoryAdmin)\n\n# After migrating, run:\npython manage.py reorder <app_label> <model_name>","lang":"python","description":"Basic setup: add app, define Sortable model, use SortableAdminMixin in admin, and reorder data."},"warnings":[{"fix":"Ensure model inherits from `adminsortable.models.Sortable` and includes `class Meta(Sortable.Meta): pass`","message":"Sortable 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'.","severity":"breaking","affected_versions":"all"},{"fix":"Switch to django-admin-sortable2 for better Django 3+/4+ support.","message":"This 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).","severity":"deprecated","affected_versions":"2.3 and earlier"},{"fix":"Ensure parent model uses Sortable mixin or admin uses SortableAdminMixin.","message":"Inline sorting (SortableTabularInline, SortableStackedInline) often fails if the parent model is not also sortable. Inline sort order may not save correctly.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Run 'pip install django-admin-sortable' and add 'adminsortable' to INSTALLED_APPS.","cause":"Library not installed or not in INSTALLED_APPS.","error":"ModuleNotFoundError: No module named 'adminsortable'"},{"fix":"Add `class Meta(Sortable.Meta): pass` to the model.","cause":"Model inherits from Sortable but does not define an ordering field or Meta class.","error":"ImproperlyConfigured: 'ordering' attribute is required for sortable models."},{"fix":"Either add a PositiveIntegerField named 'my_order' to the model, or define `order_field_name` in the Meta class.","cause":"The default order field name is 'my_order', but the field does not exist in the model.","error":"django.core.exceptions.FieldDoesNotExist: Category has no field named 'my_order'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}