Also, I kept special handling for callables: they will still get called when the template asks for them as a variable, e.g.
class FooPage(rend.Page):
docFactory = genshifile('foo.xhtml')
def date(self):
return str(datetime.datetime())
(... in the template ...)
<div>$date</div>
will still produce <div>(current timestamp)</div>. Again, this is possible because lazy evaluation means never having to call things and get side effects.
Also, I kept special handling for callables: they will still get called when the template asks for them as a variable, e.g.
class FooPage(rend.Page): 'foo.xhtml' ) datetime( ))
docFactory = genshifile(
def date(self):
return str(datetime.
(... in the template ...)
<div>$date</div>
will still produce <div>(current timestamp)</div>. Again, this is possible because lazy evaluation means never having to call things and get side effects.