Thursday, December 27, 2012

dynamic, heterogeneous formset?

Hello,

I've just started using django for a relatively complex project, used other frameworks in the past.

I need to create an interface where the user can create an ordered list of elements, each element with different properties.

An example could be a page to build a questionnaire, where the user can add many 'multiple choices', a 'short question and answer', and an 'essay box'. He can add as many of them as he wishes, order has to be preserved. If he adds a multiple choice, then he can add multiple possible answers, if it's an essay box, he can specify one or more title choices.

One way to do this would be to have the main page showing the sections already entered, with buttons like 'add multiple choice', or 'add question', or 'add essay', which saves/submits the previous part and shows the page with a form to add the new section. Or use some javascript (like sheep-it) to implement the same.

If there was a single type of form, or no requirement to have them in the order specified by the user, I could use one (or more) formsets. Have an add button to submit and show the page with an extra empty form.

Is there some pre-made formset-like library to automate this kind of form generation and handling?

Thanks!!
Marco

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/_x8bv8-Alu0J.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

No comments:

Post a Comment