Creating a model object with a M2M and FK relationship
问题 I have the following model -- class Category(models.Model): category = models.CharField(max_length=100) class Credit(models.Model): person = models.CharField(max_length=100) position = models.CharField(max_length=100) class Video(models.Model): title = models.CharField(max_length=100) category = models.ForeignKey(Category) credits = models.ManyToManyField(Credit) I have created the following Category and Credit objects -- >>> Category.objects.create(category='animation') >>> Category.objects