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.6.1.tar.gz (15.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

django_admin_ordering-0.6.1-py2.py3-none-any.whl (17.0 kB view details)

Uploaded Python 2Python 3

File details

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

File metadata

File hashes

Hashes for django-admin-ordering-0.6.1.tar.gz
Algorithm Hash digest
SHA256 8083ad5ef6e99d781ddd3abaebdbde00d17ede325b59c9c98757376b5c9a63eb
MD5 86ea184c5906e6af99ff4c38a5109563
BLAKE2b-256 937d0003ff846e966fb69fc287d2adc7311fefdd870fd4e21c207ecfa5b37758

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for django_admin_ordering-0.6.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 fb2e956ad5abc5ddda38d44b13241282c112a35b59c2481a743dfc27366dd289
MD5 850dd9337a6396fe84169e80ac235330
BLAKE2b-256 fed996cc5f4161cb080e7a97dc60b3a0e5ac4d67824c220c7226c90b1dc5db18

See more details on using hashes here.

Supported by

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