In my Django admin UI I use a TabularInline
like this:
class MyCustomInline(admin.TabularInline):
# ...
def get_queryset(self, request):
# ...
The overridden functions adds a filter, so that only a subset of related objects is displayed. In the admin UI I get table using the plural of the model class as title, which is wrong in this case. I would like to give it a custom name.
I cannot do this for the model itself, because I want to change the title only for this filtered set. Not for the model class in general.
I tried to figure it out from the source code. In the template I found out that the verbose_name
is passed in via opts
, but could not follow its path to find a way to override it.
Could somebody give me a hint how to change the title aka verbose name just for this specific TabularInline
?