Hi,
How can the inlineformset_factory be used for multiple following foreignKeys at following an example?
class Recipe(models.Model):
pub_date = models.DateTimeField('Date Published', auto_now_add = True)
title = models.CharField(max_length=200)
instructions = models.TextField()
class Ingredients(models.Model):
pub_date = models.DateTimeField('Date Published', auto_now_add = True)
title = models.CharField(max_length=200)
instructions = models.TextField()
class RecipeIngredient(models.Model):
recipe = models.ForeignKey(Recipe)
ingredient = models.ForeignKey(Ingredients)
ingredientFormSet = inlineformset_factory(Recipe, Ingredients, RecipeIngredient) doesn't seem work.
Thank you.