sorry for the confusion above.
Anything put into the "c" variable in a controller is accessible
throughout the request by Controllers and Views(templates)
${} is shorthand for "print the result of the brackets
Assuming that c.listitems is an array of list item ids, in your
template you can do:
<INPUT TYPE="hidden" NAME="listitems" VALUE="${ ','.join
(c.listitems) } " />
or
% for i in c.listitems:
<INPUT TYPE="hidden" NAME="listitems" VALUE="${i} " />
% endfor
if c.listitems is an array of objects, you might do:
% for i in c.listitems:
<INPUT TYPE="hidden" NAME="listitems" VALUE="${i.id} " />
% endfor
You should read through the tutorial and possibly the Mako templating
docs themselves. All of this information is explained in there.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"pylons-discuss" 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/pylons-discuss?hl=en
-~----------~----~----~----~------~----~------~--~---