Custom ordering for the apps and models in the admin app.
Project description
django-modeladmin-reorder-reborn
Reviving the old Django django-modeladmin-reorder
package.
Detaches model groups from the apps, granting the flexibility to organize models into various groups, change models and groups order. Custom names can be assigned to groups.
Implemented origin features
- Reorder apps in admin index - this will allow you to position most used apps in top of the page, instead of listing apps alphabetically. e.g. sites app before the auth app
- Rename app labels easily for third party apps without having to modify the source code. e.g. rename auth app to Authorisation for the django admin app.
- Split large apps into smaller groups of models.
- Reorder models within an group. e.g. auth.User model before the auth.Group model.
- Exclude any of the models from the app list. e.g. Exclude auth.Group from the app list. Please note this only excludes the model from the app list and it doesn't protect it from access via url.
Not implemented features
- Cross link models from multiple apps. e.g. Add sites.Site model to the auth app.
- Rename individual models in the app list. e.g. rename auth.User from User to Staff
New features
- Gathering models of the app that haven't been included in other groups.
Requirements
- Python >= 3.5
- Django >= 4.1
Install
Install django-modeladmin-reorder-reborn:
pip install django-modeladmin-reorder-reborn
Configuration
- Create
admin_apps.py
file in your project folder:
from django.contrib.admin.apps import AdminConfig
class MyAdminConfig(AdminConfig):
default_site = "admin_reorder.ReorderingAdminSite"
- Replace
django.contrib.admin
toproject.admin_apps.MyAdminConfig
in your settings.py:
INSTALLED_APPS = (
...
'̶d̶j̶a̶n̶g̶o̶.̶c̶o̶n̶t̶r̶i̶b̶.̶a̶d̶m̶i̶n',
'your_project_name.admin_apps.MyAdminConfig',
...
)
Add the setting ADMIN_REORDER to your settings.py:
ADMIN_REORDER = [
# Keep original label and models, but change group order
{'app': 'sites'},
# Rename app
{'app': 'auth', 'label': 'Authorisation'},
# Reorder app models
{'app': 'auth', 'models': ('User', 'Group')},
# Exclude models
{'app': 'auth', 'models': ('User', )},
# Gather not included in any group models
{'app': 'auth', 'models': '__rest__'},
]
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
Built Distribution
File details
Details for the file django-modeladmin-reorder-reborn-0.1.4.tar.gz
.
File metadata
- Download URL: django-modeladmin-reorder-reborn-0.1.4.tar.gz
- Upload date:
- Size: 4.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4284da130c46fda00e0962a520b08ee9b8e9849e338f6fa80ac167e10377a505 |
|
MD5 | 749b328239dd137782105d565285681f |
|
BLAKE2b-256 | 952961fb632f442f82b41323f3184ed2ca1928978cd28b84484616c9c9562b5c |
File details
Details for the file django_modeladmin_reorder_reborn-0.1.4-py2.py3-none-any.whl
.
File metadata
- Download URL: django_modeladmin_reorder_reborn-0.1.4-py2.py3-none-any.whl
- Upload date:
- Size: 5.0 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a2d362c9b6b891c1daf97bbc233294eea0a4a9d60cd4270a04db7548f3634ca8 |
|
MD5 | 5616ec88caf1be9604dbd6e3577d4d29 |
|
BLAKE2b-256 | 1811e5621875a695b40b932959ae56848eebf1b4422ab368aaf1e109b01bd0de |