Orderable change lists and inlines done right^Wsimple
Project description
Steps
Have a model ordered by an integer field.
Install django-admin-ordering and add admin_ordering to INSTALLED_APPS.
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.
Ensure that the field is displayed in the change form if you define fieldsets yourself, or is contained in list_editable for change lists.
Report any bugs you find (patches welcome)!
Limitations
Newly created inlines are not automatically assigned a good ordering value. This could be easily fixed for Django 1.9 by handling the 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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for django-admin-ordering-0.2.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | ffa87d8e135bb1bbf466b5be0df45276a0ed3a16e06681e4a5e2f31302ca0d55 |
|
MD5 | d67079bf228e1e30d7ca2695b01e2e49 |
|
BLAKE2b-256 | f65c236db0e5d1bdfc486ac04577cb6ef44ed5f75d7b68a7cc9ab7a8b87ea0ca |
Hashes for django_admin_ordering-0.2.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cb1e4556bff7b91c7f89c1711cb7409a04cb1a002abc22e07e5ac0a239b12ced |
|
MD5 | 1590cb0a5039553824da9d8f5e040d9f |
|
BLAKE2b-256 | 7cfb2a1a092db0c79160836a96f6a704b9d50c6bf1a259afb2f550b2805f35b2 |