Skip to content
This repository has been archived by the owner on May 9, 2020. It is now read-only.

Put most used and important models to the top of your Django admin index.

License

Notifications You must be signed in to change notification settings

KostyaEsmukov/django-admin-top-models

Repository files navigation

django-admin-top-models

Downloads Latest Version Travis-ci Coveralls License

Put most used and important models to the top of your Django admin index.

https://cloud.githubusercontent.com/assets/2418596/16707176/8b4f1a28-45ce-11e6-991a-01e17d7d5ba8.png

INSTALL

pip install django-admin-top-models

Configuration

  1. Add admin_top_models to INSTALLED_APPS:

    INSTALLED_APPS = (
        ...
        'admin_top_models',
        ...
    )
    
  2. Add admin_top_models.middleware.AdminTopModelsMiddleware to MIDDLEWARE_CLASSES:

    MIDDLEWARE_CLASSES = (
        ...
        'admin_top_models.middleware.AdminTopModelsMiddleware',
        ...
    )
    
  3. Add ADMIN_TOP_MODELS_CONFIG setting to your settings.py:

    ADMIN_TOP_MODELS_CONFIG = (
        ('firstapp', ('First', 'Third')),
        ('secondapp', ('DModel', 'CModel', 'AModel')),
        ('auth',),
    )
    
  4. Adjust other options (if you need to. These are defaults):

    # should the '--------------------' spacer be added between your top and the rest models?
    ADMIN_TOP_MODELS_INSERT_SPACER = True
    
    ADMIN_TOP_MODELS_SPACER_NAME = '-' * 20
    
    # if this is set to True, order of apps and models will be the same across different languages,
    # otherwise django's order by translated names will be used.
    ADMIN_TOP_MODELS_ALWAYS_SORT_BY_OBJECT_NAME = False
    

About

Put most used and important models to the top of your Django admin index.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages