You can make modules and functions globals by adding them to 'globals'
when you create the template. See http://webpy.org/docs/0.3/templetor
for more info.
For example, in your python code:
import web, re
render = web.template.render('templates/', globals={'re':re})
Then, in your template:
$re.sub('foo', 'bar', 'foo goes away')
Good luck,
Justin
On Aug 11, 1:52 pm, Zak <[email protected]> wrote:
> Hi All,
> I have a quick question. Is it possible using re.sub (python module
> re) in template files? I want to do some substitution dynamically
> during rendering.
> Thanks.
--
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.