Skip to main content

Orderable change lists and inlines done right^Wsimple

Project description

https://travis-ci.org/matthiask/django-admin-ordering.svg?branch=master

Steps

  1. Have a model ordered by an integer field.

  2. Install django-admin-ordering and add admin_ordering to INSTALLED_APPS.

  3. Inherit admin_ordering.admin.OrderableAdmin in your own ModelAdmin and StackedInline/TabularInline subclasses and set ordering_field to a field name of the ordering integer field. Also set fk_name to the parent foreign key if you want orderable inlines. Do absolutely nothing if you want an orderable changelist.

  4. Ensure that the field is displayed in the change form if you define fieldsets yourself, or is contained in list_editable for change lists.

  5. Report any bugs you find (patches welcome)!

Limitations

  • 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.

  • Only one inline can use this app per model right now.

  • OrderableAdmin can be used both for inlines and parents, but this also means that you cannot register a model directly with OrderableAdmin.

Project details


Download files

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

Source Distribution

django-admin-ordering-0.4.0.tar.gz (18.1 kB view details)

Uploaded Source

Built Distribution

django_admin_ordering-0.4.0-py2.py3-none-any.whl (20.8 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file django-admin-ordering-0.4.0.tar.gz.

File metadata

File hashes

Hashes for django-admin-ordering-0.4.0.tar.gz
Algorithm Hash digest
SHA256 c20e1fae627383375d81d28808a0a5cbccddb6ff4b7b666c29fb03722b1ec007
MD5 f7467afe73f9ed6f34587b89c2ceda19
BLAKE2b-256 5bce9d95dae34f9fbcca542d04eaa60542cffaeaff27648d6a1b5d2b023a31e9

See more details on using hashes here.

File details

Details for the file django_admin_ordering-0.4.0-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for django_admin_ordering-0.4.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 77df2c3299ba0c53d4f141fad17c8ad244cdd75e94466cc89060c849f31c562c
MD5 1fb3eee15a54c0e64b6cef24cc46effa
BLAKE2b-256 5b19f65a2247d45a9e8117cb2f4b466ba7ae675e9c4c723ccc6adf541e3bca54

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page