Custom ordering for the apps and models in the admin app.
Project description
django-modeladmin-reorder-reborn-again
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.
- 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.
- Create virtual app groups with models from multiple apps.
Requirements
- Python >= 3.5
- Django >= 4.1
Install
Install django-modeladmin-reorder-reborn-again:
pip install django-modeladmin-reorder-reborn-again
Configuration
- Create
admin_apps.pyfile in your project folder:
from django.contrib.admin.apps import AdminConfig
class MyAdminConfig(AdminConfig):
default_site = "admin_reorder.ReorderingAdminSite"
- Replace
django.contrib.admintoproject.admin_apps.MyAdminConfigin 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', )},
# Cross-linked models from multiple apps
{'app': 'auth', 'models': ('auth.User', 'sites.Site')},
# Models with custom names
{'app': 'auth', 'models': (
'Group',
{'model': 'auth.User', 'label': 'Staff'},
)},
# Create virtual app groups with models from multiple apps
{'app': 'user_management', 'label': 'User Management', 'models': (
'auth.User',
'auth.Group',
'sites.Site',
)},
# Gather not included in any group models
{'app': 'auth', 'models': '__rest__'},
]
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file django_modeladmin_reorder_reborn_again-0.1.0.tar.gz.
File metadata
- Download URL: django_modeladmin_reorder_reborn_again-0.1.0.tar.gz
- Upload date:
- Size: 11.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
329b127035010a716b3a61bed144e5324b7b23c09e9ec33a46fe68cdc606ff51
|
|
| MD5 |
2ea5b92a9ecfee741f4e50d3aebd4a41
|
|
| BLAKE2b-256 |
4dbb456b2448971bb646b229f9df512befa4c096362c3be057c383b44187c135
|
File details
Details for the file django_modeladmin_reorder_reborn_again-0.1.0-py2.py3-none-any.whl.
File metadata
- Download URL: django_modeladmin_reorder_reborn_again-0.1.0-py2.py3-none-any.whl
- Upload date:
- Size: 11.4 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
574b7dd70914eb4dc9ad57f5c75f77fdab14536080ade52ea07343f681b5642a
|
|
| MD5 |
22487bf646e0374ce4c6e47ae7c577ea
|
|
| BLAKE2b-256 |
dc5870cfd3833f8aacefed2debd1fdbc0f866a2b1decda24ef627ba682226809
|