On 23-Apr-09, at 6:31 PM, Dennis Schmidt wrote:

> Hi there,
>
> I need to dynamically create complex forms in my application. Since
> version 1.0 django has these form wizards, which can manage complex
> forms quite well.  Now my only problem is, that they apparently have
> to be statically mapped by the urls.py. But what I need is a
> different set of forms for the wizard, depending of an ID specified
> in the URL.
>
> ie /order/1/accept/ shall use OrderAcceptionWizard([OrderPartOneForm,
> OrderPartTwoForm]) but
> /order/2/accept/ shall use OrderAcceptionWizard([OrderPartOneForm,
> OrderPartThreeForm]).

You could always tap into process_step() (a method of the
FormWizard[0] class) and alter self.form_list dynamically based on some
criterion. self.form_list is a list of Form classes that are used to
create forms at different steps of the wizard.

[0] 
<http://docs.djangoproject.com/en/dev/ref/contrib/formtools/form-wizard/#django.contrib.formtools.wizard.FormWizard.process_step
 
 >

-- 
Ayaz Ahmed Khan

An evil mind is a great comfort.

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

Reply via email to