I want to display the level field of the category to which the product is related on the object\'s admin page.
category
product
class Category(m
Define a method on the ModelAdmin class which returns the value of the related field, and include that in list_display.
list_display
class ProductAdmin(admin.ModelAdmin): list_display = ('name', 'level') model = Product def level(self, obj): return obj.category.level