On Django 1.2.3 i am trying to get a dynamic form working. On the
first page a user have to give their address/client id and on the
second page customers can order dishes for catering.

To dynamically add forms on the second page i use
http://code.google.com/p/django-dynamic-formset/

Here is my models.py:

*****
class Catering(models.Model):
        customer_id = models.CharField(max_length=20)
        company = models.CharField(max_length=40)

class DishesForm(forms.Form):
    gerecht = fields.CharField(max_length=200)
    aantal = fields.IntegerField(required=False)

DishesFormset = formsets.formset_factory(DishesForm)

class TestWizard(FormWizard):
        def done(self, request, form_list):
                return render_to_response('testwizard', {
                        'form_data': [form.cleaned_data for form in
form_list],
                })
*****

urls.py:

*****
    (r'^testwizard/$', TestWizard([CateringForm, DishesFormset])),
*****

The problem i have is that in the template I can only call the
complete form with {{form}} . In order to get the javascript working
properly I need to call the fields seperately like <td>{{form.gerecht}}
</td>

When i test the dynamic form (DishesFormset) seperately without the
formwizard everything works fine.

How do i call the seperate formfields within the formwizard?


-- 
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