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.
Filename, size | File type | Python version | Upload date | Hashes |
---|---|---|---|---|
Filename, size django_admin_ordering-0.3.0-py2.py3-none-any.whl (21.1 kB) | File type Wheel | Python version 2.7 | Upload date | Hashes View |
Filename, size django-admin-ordering-0.3.0.tar.gz (18.5 kB) | File type Source | Python version None | Upload date | Hashes View |
Close
Hashes for django_admin_ordering-0.3.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 834f13672b1cef4a3048bd742cb43632812d4a1a71463b6cd1d7c971d3930226 |
|
MD5 | 9319859202c7a7a49c10e12beb5fac07 |
|
BLAKE2-256 | adc0c92ea299c3d2ff483bc7d50458442a396db2689df4a9fb5cc5f6c3f4f61a |
Close
Hashes for django-admin-ordering-0.3.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 82cbd0d3bffa5bf22c1b0996e14563aee598192e8ad10eb6970e6606ead7f8a6 |
|
MD5 | 62a7f1dc8e07000edf0b3e547fdfe1ec |
|
BLAKE2-256 | ba1b0b4f8c788c8cb48dd43e5c77acd27d0bb7c3d150875c1e2026a68bde0bfc |