django-modeladmin-reorder icon indicating copy to clipboard operation
django-modeladmin-reorder copied to clipboard

Enhancement: Custom URL for grouping

Open pykong opened this issue 6 years ago • 0 comments

@mishbahr Thank you for putting up this gem of Django extension. It is a lifesaver when you got a project with 50+ models to administer.

A minor improvement could be to provide a custom url for renamed apps/model grouping. Right now renaming a model will not change the link to it. Often times you may want to use django-modeladmin-reorder to group an apps' models to provide structure to the admin site. Especially when including into a navigation bar it would come handy to jump to a specific group right away.

Possible configuration example for grouping models of an app into GroupOne and GroupTwo, each retrievable by its distinct URLs.

ADMIN_REORDER = (
    {
        'app': 'sites',
        'label':''GroupOne',
        'url': 'groupone'
        'models': ('auth.ModelOne', 'auth.ModelTwo')},
   },
    {
        'app': 'sites',
        'label':''GroupTwo',
        'url': 'grouptwo'
        'models': ('auth.ModelThree', 'auth.ModelFour')},
   },
)

pykong avatar Dec 05 '18 13:12 pykong