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.

  • 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.7.0.tar.gz (16.0 kB view details)

Uploaded Source

Built Distribution

django_admin_ordering-0.7.0-py2.py3-none-any.whl (16.9 kB view details)

Uploaded Python 2 Python 3

File details

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

File metadata

File hashes

Hashes for django-admin-ordering-0.7.0.tar.gz
Algorithm Hash digest
SHA256 88b8398a6897c5c2cb1896e21dd1711d7b4a2878f7be4c78e40db4a671b1db53
MD5 dfbaf4fde2f3f4289e64b6e101d561bf
BLAKE2b-256 5da88caec7d6f775b239c0c69551060debf4ef775e90a2b43251c0ec4637df08

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for django_admin_ordering-0.7.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 4b6f00c2883b0ec00dd540581e6ab32498e951b9be6a584703852e64c93f6f68
MD5 6a87c1e93c90ba8c952e3097d6b61421
BLAKE2b-256 1bc5a9bfdf26812e537dfb3e536d37aee2d79e3633f1f513368ce2e048a23b8d

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