Much appreciated the responses.
 % for i in c.listitems:
>     <INPUT TYPE="hidden" NAME="listitems" VALUE="${i} " />
> % endfor

The above was the approach I thought about but this looks a wee' bit
verbose creating multiple instances
. Instead I think I will limit the passing of context objects to be no
more than a single element and push the list into
a DB which it will eventually end up.


Thanks,
Gazza


On Nov 9, 6:01 pm, Jonathan Vanasco <[email protected]> wrote:
> 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
-~----------~----~----~----~------~----~------~--~---

Reply via email to