Skip to main content

Custom ordering for the apps and models in the admin app.

Project description

http://img.shields.io/travis/mishbahr/django-modeladmin-reorder.svg?style=flat-square Latest Version Downloads License

Custom ordering for the apps and models in the admin app. You can also rename, cross link or exclude models from the app list.

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 app. 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

  • Adds all of the above to Django 3.1 Admin Sidebar

Documentation

The full documentation is at https://django-modeladmin-reorder.readthedocs.org.

Install

Install django-modeladmin-reorder:

pip install django-modeladmin-reorder

Configuration

  1. Add admin_reorder to INSTALLED_APPS:

    INSTALLED_APPS = (
        ...
        'admin_reorder',
        ...
    )
  2. Add the ModelAdminReorder to MIDDLEWARE_CLASSES:

    MIDDLEWARE_CLASSES = (
        ...
        'admin_reorder.middleware.ModelAdminReorder',
        ...
    )
  3. Add the setting ADMIN_REORDER to your settings.py:

    ADMIN_REORDER = (
        # Keep original label and models
        'sites',
    
        # Rename app
        {'app': 'auth', 'label': 'Authorisation'},
    
        # Reorder app models
        {'app': 'auth', 'models': ('auth.User', 'auth.Group')},
    
        # Exclude models
        {'app': 'auth', 'models': ('auth.User', )},
    
        # Cross-linked models
        {'app': 'auth', 'models': ('auth.User', 'sites.Site')},
    
        # models with custom name
        {'app': 'auth', 'models': (
            'auth.Group',
            {'model': 'auth.User', 'label': 'Staff'},
        )},
    )

History

0.1.0 (2014-08-01)

  • First release on PyPI.

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

django-reorder-admin-0.3.1.tar.gz (8.0 kB view details)

Uploaded Source

Built Distribution

django_reorder_admin-0.3.1-py2.py3-none-any.whl (6.8 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file django-reorder-admin-0.3.1.tar.gz.

File metadata

  • Download URL: django-reorder-admin-0.3.1.tar.gz
  • Upload date:
  • Size: 8.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.5.0.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.6.8

File hashes

Hashes for django-reorder-admin-0.3.1.tar.gz
Algorithm Hash digest
SHA256 4271398a4c1d2e79fc8ab400fd4741445382a4c7492244d324d7165f302d10fe
MD5 c1c08c027a2cca6344f90f458757e55d
BLAKE2b-256 bc8440715d37a2280d6253a16b6356298c0996b6d3c5bb908dbbe40e8f558349

See more details on using hashes here.

File details

Details for the file django_reorder_admin-0.3.1-py2.py3-none-any.whl.

File metadata

  • Download URL: django_reorder_admin-0.3.1-py2.py3-none-any.whl
  • Upload date:
  • Size: 6.8 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.5.0.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.6.8

File hashes

Hashes for django_reorder_admin-0.3.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 059eb7bccd36429e712c36dbc762664434069a290736fa74e7dba7446669e8b6
MD5 5f5f1c1c7997ef1e47c5c68c89fb0a47
BLAKE2b-256 0e60014943b6d35853839f23951b78b66b24ed0c749baff89ea92dd2232beeb3

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page