I need to change the inline title
to something else other than the verbose_name
of the class Meta in the model. Is there an attribute to achieve this?
One of the most powerful parts of Django is the automatic admin interface. It reads metadata from your models to provide a quick, model-centric interface where trusted users can manage content on your site. The admin's recommended use is limited to an organization's internal management tool.
Django provides a default admin interface which can be used to perform create, read, update and delete operations on the model directly. It reads set of data that explain and gives information about data from the model, to provide an instant interface where the user can adjust contents of the application .
Overview. The Django admin application can use your models to automatically build a site area that you can use to create, view, update, and delete records. This can save you a lot of time during development, making it very easy to test your models and get a feel for whether you have the right data.
As documented, 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"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With