Spider ha scritto:

> What about the "2 days ago" type of contruct? I can code a function to
> generate the text easily enough, but where should the function
> definition reside? It could go in a ?python block (as of Genshi 0.4)
> but that doesn't quite feel right. Maybe the controller, but in that
> case how do I make Genshi "see" the controller's namespace?
>   

Check turbogears.view.variable_providers

Something like


def addvars(vrs):
    vrs.update({'displaydate': displayDateFunction})

view.variable_providers.append(addvars)


then you can refer to tg.displaydate(...) from inside any template

Of course you can pass down whole modules and namespaces to templates


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TurboGears" 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/turbogears?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to