[Django]-Many-To-Many Fields View on Django Admin

37👍

I believe what you want is a filter_horizontal widget used in the Admin template. This should help: Django Admin ManyToManyField

1👍

currently i am able to display many to many fields is admin panel

models.py

class Abc(models.Model):
    course = models.ManyToManyField(Course, blank=True)

admin.py

class AbcsAdmin(admin.ModelAdmin):
    """
    Admin panel management for Alumni
    """
list_display = ["id","get_course"]

def get_course(self,obj):
    return [course.name for course in obj.course.all()]

Leave a comment