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.
Source Distribution
Built Distribution
File details
Details for the file django-admin-ordering-0.6.0.tar.gz
.
File metadata
- Download URL: django-admin-ordering-0.6.0.tar.gz
- Upload date:
- Size: 17.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ef56a46cff073e5c217822de4ce3627bf1619160dabdddc139b989f6411e90d5 |
|
MD5 | da40cc3b7a9d6eccdc9a6be8c7cf2058 |
|
BLAKE2b-256 | 0915ff143bda792a14254c544d42efc34c78870f093cb436b24e1e935dca634d |
File details
Details for the file django_admin_ordering-0.6.0-py2.py3-none-any.whl
.
File metadata
- Download URL: django_admin_ordering-0.6.0-py2.py3-none-any.whl
- Upload date:
- Size: 21.6 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 17ec203327d55e486f06fc5fc86b4dfb91e26c697c16dfa253db4e7a7c793f5a |
|
MD5 | 6b3bdb8ec4efbc5e1d7e93ce291ccc8a |
|
BLAKE2b-256 | 2d7c1b8b2af54ae65404f801fe5034734d4fb733e6293543203a38cb4ac6fc93 |