Many-To-Many Fields View on Django Admin
28,264
I believe what you want is a filter_horizontal
widget used in the Admin template. This should help: Django Admin ManyToManyField
Author by
Nameless
Updated on September 11, 2020Comments
-
Nameless almost 4 years
Basically I am trying to recreate a fields in this model that is similar to django user authenticate system, for this I try using many-to-many fields but it ended up like this.
I am trying to have another field that can show what exist and another field for I have chosen similar to django admin, which looks like this.
This is my code
class Category(models.Model): name = models.CharField(max_length=128, unique=True) class BlogPage(models.Model): category = models.ManyToManyField(Category) title = models.CharField(max_length=128) preview = models.TextField(max_length=256) content = models.TextField()