Group models in django admin

Is there a way to group models in the django admin interface?

Currently, I have an application with requests with the following models displayed on the admin site:

**Requests** Divisions Hardware Requests Hardware Types Requests Software Requests Software Types 

I would like departments, software requests, and hardware requests to be grouped separately in the Types group. I know that I can override and hardcode the admin / index.html and base_site.html, but this seems pretty confusing just to indicate grouping.

Is there anything I can add to the Meta class to indicate the name of the group?

The only way I have found so far to achieve what I want is to move the models to the new application in the queries ("queries.Types"), but again, it doesn't seem like this is the "right way".

+6
django django-models django-admin
source share
1 answer

There is nothing that can be done in the definition of a model, because the models - by design - do not know about the existence of an administrator or how they will be presented in the admin.

This is really the case when you just write a template that does what you want and use it; all you ask for is a presentation change, and templates are where you make a presentation in Django.

+6
source share

All Articles