On 22/04/10 12:22, Branko Vukelic wrote:
On Thu, Apr 22, 2010 at 11:49 AM, Ferran Fontcuberta<[email protected]>  wrote:
Something like this. I want to use $input.name in the template without using
an if construction if there are not defined in input.

Don't pass input into template. Not very safe. Create a custom
web.storage object and assign it whatever attribs you need.

mydata = web.storage()

mydata.name = i.name
mydata.surname = i.surname

Then in template:

$(mydata.name or "You haven't specified a name.")


Oh! I wasn't aware of the $() expression, thanks a lot!

Why isn't safe to pass input into template?

Thank you again

--
You received this message because you are subscribed to the Google Groups 
"web.py" 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/webpy?hl=en.

Reply via email to