Django automatically creates an intermediate model for the m2m relationship and creates a detailed name as "% (from) s -% (to) s ratio", marked for translation. You can use a more appropriate translation to influence the change throughout the site. Gettext definition for search:
'%(from)s-%(to)s relationship'
'%(from)s-%(to)s relationships'
You can override the automatically generated verbose_name and verbose_name_plural for AdminInline, which controls the many-to-many relationship:
class CategoryInline(admin.TabularInline):
model = BaseProduct.categories.through
verbose_name = "Category item"
verbose_name_plural = "Category items"
To define a unicode method, see the answer with published solutions for using a proxy model and a monkey patch unicode .
Django: Friendier header for StackedInline for auto generated through model?
source
share