How to access manytomany field content

2019-06-19 Thread Андрей Сердюк
Hi, if Your code looks like this: class Category(models.Model): name = models.CharField(maxlength=32) pass class Goods(models.Model): categories = models.ManyToManyField(Category, on_delete=models.CASCADE) You would get it with this code: category = Category.objects.get(pk=23) goods

Re: How to access manytomany field content

2019-06-19 Thread Андрей Сердюк
So You should to show Your template first and use ModelForm to inherit it with model You need in meta options. -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to d