Skip to main content

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

CHANGELOG

1.1.0 (2016-08-04)

  • Fixed setuptools complaining about missing django

1.0.0 (2016-07-19)

  • Fixed settings being deadly cached

  • Added more tests to reach 100% coverage

0.0.3 (2016-07-09)

  • Fixed RST inconsistent title levels in the README

0.0.2 (2016-07-09)

  • Added README

  • Fixed IndexError when a second item of the config tuple is absent, like in ('thirdapp',)

  • Fixed spacer position shift when the config includes models which are not actually present

0.0.1 (2016-07-08)

  • Initial working version

Release files for django-admin-top-models 1.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for django-admin-top-models 1.1.0
File Size Uploaded
django-admin-top-models-1.1.0.tar.gz 9.0 kB Details

Release files / django-admin-top-models-1.1.0.tar.gz

Download URL django-admin-top-models-1.1.0.tar.gz
Size 9.0 kB
Tags Source
SHA-256 checksum
How to use checksums
ffc40d07e7cfdb7b0c02ac92940c7b5de268afbd9838d411d77938e01eeffdb1
BLAKE2b-256 checksum
How to use checksums
04ae6da5df3bc4faee31382fc24438d728155f7d55026ed170d69e4e8da10c37
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

1.1.0 This release

1 release file

1.0.0

1 release file

0.0.3

1 release file

0.0.2

1 release file

0.0.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page