Answer the question
In order to leave comments, you need to log in
How to remove a column from a many-to-many relation in the django admin?
Hello! Can you please tell me how to display a column from a many-to-many relationship in the django admin panel?
class books(models.Model):
name = models.CharField(max_length=50, verbose_name=u'Название книги')
year = models.IntegerField(max_length=10, verbose_name=u'Год выпуска')
author = models.ManyToManyField(author)
class author(models.Model):
full_name = models.CharField(max_length=50, verbose_name=u'Автор')
from django.contrib import admin
from support.models import books, author
@admin.register(Author)
class BooksAdmin(admin.ModelAdmin):
list_display = ['name', 'year', 'ЧТО_ТУТ_НАПИСАТЬ?']
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question