How to set other Inline title in Django Admin

0 votes
I need to change the inline title (name) to something other than the verbose_name of the class Meta in the Model. Is there a variable to do this?
Jun 29, 2020 in Python by kartik
• 37,510 points
580 views

1 answer to this question.

0 votes

Hii @kartik,

You need to set the values of your InlineModelAdmin subclass:

InlineModelAdmin.verbose_name - An override to the verbose_name found in the model’s inner Meta class.

InlineModelAdmin.verbose_name_plural - An override to the verbose_name_plural found in the model’s inner Meta class.

In this example, instead of the title 'Device' we use 'Phone':

class DeviceInline(admin.TabularInline):
    model = Device
    verbose_name = "Phone"
    verbose_name_plural = "My Phones"

Hope it helps!

answered Jun 29, 2020 by Niroj
• 82,720 points

Related Questions In Python

0 votes
1 answer

How to set up a PostgreSQL database in Django?

Hello @kartik, Steps that I use: - sudo apt-get ...READ MORE

answered Jun 30, 2020 in Python by Niroj
• 82,720 points
148 views
0 votes
1 answer

How to switch pages using Ajax in Django?

You should use django-pjax which is built exactly for ...READ MORE

answered Oct 9, 2018 in Python by aryya
• 7,440 points
604 views
0 votes
1 answer

How to get all related Django model objects in Python?

This actually gives you the property names ...READ MORE

answered Nov 14, 2018 in Python by Nymeria
• 3,520 points

edited Dec 18, 2018 by Nymeria 4,130 views
0 votes
1 answer

How to temporarily disable a foreign key constraint in MySQL?

Hello @kartik, To turn off foreign key constraint ...READ MORE

answered Jun 23, 2020 in Python by Niroj
• 82,720 points
771 views
0 votes
1 answer

How do I use Django templates without the rest of Django?

Hello @kartik, Let's say you have this important ...READ MORE

answered Jun 23, 2020 in Python by Niroj
• 82,720 points
315 views
0 votes
1 answer

How to load a custom JS file in Django admin home?

Hello @kartik, You can override templates/admin/index.html and add the JavaScript ...READ MORE

answered May 14, 2020 in Python by Niroj
• 82,720 points
2,529 views
0 votes
1 answer

How to set the encoding for the tables' char columns in django?

Hello @kartik, Django does not specify charset and ...READ MORE

answered Jun 24, 2020 in Python by Niroj
• 82,720 points
330 views