Skip to main content

Orderable change lists and inlines done right^Wsimple

Project description

django-admin-ordering -- Orderable change lists and inlines done right^Wsimple

.. image::

Please refer to the Travis CI build linked above for the currently
supported combinations of Python and Django.


``pip install django-admin-ordering``, and add ``admin_ordering`` to


First, you need a model ordered by an integer field.

Orderable change lists


from admin_ordering.admin import OrderableAdmin

class MyModelAdmin(OrderableAdmin, admin.ModelAdmin):
# The field used for ordering. Prepend a minus for reverse
# ordering: '-order'
ordering_field = 'order'

# You may optionally hide the ordering field in the changelist:
# ordering_field_hide_input = False

# The ordering field must be included both in list_display and
# list_editable:
list_display = ('name', 'order', )
list_editable = ('order', )

Orderable inlines


from admin_ordering.admin import OrderableAdmin

class MyModelTabularInline(OrderableAdmin, admin.TabularInline):
model = MyModel

# You have to set the name of the parent foreign key yourself:
fk_name = 'parent'

# Same as above; '-order' is also allowed here:
ordering_field = 'order'
# ordering_field_hide_input = False


- Starting with Django 1.9 newly created inlines are automatically assigned
a good ordering value. Earlier versions do not support the required
``formset:added`` signal.
- ``OrderableAdmin`` can be used both for inlines and parents, but this
also means that you cannot register a model directly with

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for django-admin-ordering, version 0.8.0
Filename, size File type Python version Upload date Hashes
Filename, size django_admin_ordering-0.8.0-py2.py3-none-any.whl (18.8 kB) File type Wheel Python version py2.py3 Upload date Hashes View hashes
Filename, size django-admin-ordering-0.8.0.tar.gz (17.4 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page