On 25-6-2012 12:52, het.oosten wrote:
> Thank you for your help!
> 
>> I don't understand your questions.
> 
> I am sorry about that, I probably ask my question the wrong way
> because of my lack of experience
> 
>> A formset is a set of forms. What would {{ formset.dish }} even refer to?
>> Only the forms inside the formset have a `dish` field.
> 
> When I try {% for form in formset %}{{form.dish}}
> 
> I get a "non iterable" error
The error doesn't apply to form.dish. Iterable errors refer to trying to
walk a variable that can't be walked, so the issue here is that formset
is not walkable. The code here irks me, cause you're using names that
may apply to django code. So just to be sure that's not the case, in
your view pass the DishesFormset() to the template as 'dishes_ordered'
or just 'borden' (using non-english language for variable names is a
good way to duck name clashes, allthough it makes it less readable for
people not familiar with the language).


> def testform(request):
>         if request.method == 'POST':
>                       form = AddressForm(request.POST)
>                 formset = DishesFormset(request.POST)
>                 if formset.is_valid():
>                         return render_to_response('test', {
>                                 'form_data': formset.cleaned_data,
>                         })

So hmm, you're re-presenting the form on the same url? I guess for
debugging that works, but generally you'd redirect here.
-- 
Melvyn Sopacua


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