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
- 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
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.6.2-py2.py3-none-any.whl (17.0 kB) | File type Wheel | Python version py2.py3 | Upload date | Hashes View |
Filename, size django-admin-ordering-0.6.2.tar.gz (17.6 kB) | File type Source | Python version None | Upload date | Hashes View |
Close
Hashes for django_admin_ordering-0.6.2-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3b75b3a79ad73f3ed64b26aa47587bc9956e33227bf4ea5b505544d563ff42f6 |
|
MD5 | e8e88402408facaeb136c2dbdea633e1 |
|
BLAKE2-256 | 8286058939d8bd030b75dd9b1e81b5cdcdc67b6b9565532434a6c702227a53e3 |
Close
Hashes for django-admin-ordering-0.6.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | b6bb2a139aa1deff50fff65a9836db4dae655149e27873c26a6b4af573e5df03 |
|
MD5 | e9fcc52c430c0e4de3463263e9a903d1 |
|
BLAKE2-256 | 10593fae25f85ebbb013e479cd4559f5b5a9a7da971ccbdc9aedf281b5d5080d |