# 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.html has
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
Ok, I see. It seems the main point is that if you want to use a
controller for both html and json, then passing widgets in the return
dict will be unnecessary and potentially causing problems with
jsonification. So it is a better practice to pass these via the template
context instead. Seems reasonable to me, this should just be better
explained and documented.
-- Christoph
+1.
--
Gustavo Narea <http://gustavonarea.net/>.
Get rid of unethical constraints! Get freedomware:
http://www.getgnulinux.org/