What is the best way to handle a page with multiple forms and an unknown number of elements in one of the forms?
Lets suppose I have 3 models, Book, Recipe and Ingredient and these need to be displayed on the same web page. Each Book can also hold any number of Recipes and each Recipe can hold any number of Ingredients. Each of these models will also have a form that inherits from ModelForm.
Once the form is displayed to the user, she is free to dynamically add as many Recipes or Ingredients a she needs. This is to be done via JS with no Ajax.
What is the best way to handle this when validating forms? Validating the form for Book is easy but how do I handle the unknown number of Recipes and Ingredients?