How do you send a function from a view to a Jinja2 template?
47 views
Skip to first unread message
Rosciuc Bogdan
unread,
Nov 16, 2014, 1:37:15 PM11/16/14
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Sign in to report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to pylons-...@googlegroups.com
Hello all,
Pretty much what the title says. I've been trying to send a function I have created in a view to a Jinja2 template and I can't figure it out how. Could you please help me with this... an example may be useful as well.
Thank you,
Bogdan
Michael Merickel
unread,
Nov 16, 2014, 4:40:15 PM11/16/14
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Sign in to report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Pylons
You send a function just like any other object. By returning it as the
value in a dictionary.
python:
def hello_fn(name):
return 'Hello ' + name