Написал в админке метод который должен выводить столбец, но он не появляется
Models
from django.db import models
class Kitch(models.Model):
name = models.CharField(max_length=200)
def __str__ (self):
return "{}".format(self.name)
class ViewKitch(models.Model):
Kitch = models.ManyToManyField(Kitch)
namecook = models.CharField(max_length=200)
def __str__ (self):
return "{} {}".format(self.namecook)
Admin
from django.contrib import admin
from .models import *
class KitchAdmin(admin.ModelAdmin):
def kitchname(self, obj):
return ", ".join([str(i.namecook) for i in obj.ViewKitch_set.all()])
list_display = ['name', 'kitchname']
admin.site.register(Kitch, KitchAdmin)