pylons.c.form is the correct way to pass the form to the template.

I believe you could also import tmpl_context from tg and say:

tmpl_context.form = form.

That would probably be the more TG way of doing things.

The reason we no longer pass the form into the template dictionary is
because it is not data.  Therefore we add the form to the template
context which defines how the template should be drawn, not what data
should be displayed.  There was a discussion on this a while back if
you search around.

cheers.
-chris

On Feb 9, 7:49 am, Christoph Zwerschke <[email protected]> wrote:
> Athttp://toscawidgets.org/documentation/tw.forms/tutorials/tg2.htmlI
> found the following:
>
>     # Passing the form in the return dict is no longer kosher, you can
>     # set pylons.c.w.form instead and use c.w.form in your template
>     # (remember to 'import pylons' too)
>     pylons.c.w.form = model_form
>
> http://turbogears.org/2.0/docs/main/ToscaWidgets/forms.htmlhas
> something similar, but without the comment.
>
>     pylons.c.form = create_movie_form
>
> Why is passing a form in the return dict of a controller no longer
> "kosher"? If it is really a problem, we need more explanations here.
> Also, which one is correct/better, pylons.c.form or pylons.c.w.form?
> Even more confusing, the template uses tmpl_context resp. tmpl_context.w
>  instead of the c alias.
>
> -- Christoph
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TurboGears Trunk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/turbogears-trunk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to