I just did it with proxy models so that the models can be grouped under one heading. I realized that you can adjust the sort order by simply changing the verbose_name and verbose_name_plural proxy models. That way, the top-level name can be reached using "+ ._ meta.verbose_name, while others can simply be reordered to 1., 2. 3., ...
I am sure that this is not what you are looking for, but it was as easy as I could achieve with acceptable results.
# foo/admin.py from django.contrib import admin from zoo.models import Zoo class ZooProxy(Zoo): class Meta: proxy = True app_label = 'foo' verbose_name = " " + Zoo._meta.verbose_name verbose_name_plural = " " + Zoo._meta.verbose_name_plural # one/admin.py from django.contrib import admin from one.models import One class OneProxy(One): class Meta: proxy = True app_label = 'foo' verbose_name = "2. " + One._meta.verbose_name verbose_name_plural = "2. " + One._meta.verbose_name_plural # two/admin.py from django.contrib import admin from two.models import Two class TwoProxy(Two): class Meta: proxy = True app_label = 'foo' verbose_name = "1. " + Two._meta.verbose_name verbose_name_plural = "1. " + Two._meta.verbose_name_plural
run the django admin command:
Foo: Zoo 1. Two 2. One -vs- Foo: One Two Zoo
imdaveho
source share