← Home · ↑ July 2011 · Bookmark #17896

CookBookNewFormsDynamicFields – Django

But what if you're allowing your users to create their own survey questions, so that you don't know ahead of time how many answers you'll need? Luckily, you can add fields to the form as you're constructing it, in addition to specifying them as class attributes. If you have all your survey questions in a list (let's call it questions just to be confusing), you could create a Survey class that looks like this:
Saved on