Hello,
How can I modify the Mako configuration options from within TG? Loading of
template options seems to be hardcoded (I'm talking 1.0 here, didn't check
other versions) and the only two options that are currently included are
mako.directories and mako.output_encoding. In my application I need access
to mako.default_filters and mako.imports as well (see
http://www.makotemplates.org/docs/filtering.html#filtering_expression_defaultfilters).
If anyone has any suggestions on how to do this without modifying the TG
code that would be most appreciated.

For the meantime, I have resorted to exactly that. I have attached a patch
where I've added these extra configuration paramaters with given defaults.
This patch also makes using Mako with Turbogears more intuitive, by adding a
default to mako.directories that enables you to use Mako templates just like
you would do with Kid, without having to edit the configuration (see
http://groups.google.com/group/turbogears/browse_thread/thread/aed7d087c7b958e8/038e641ce47dc665
).

Is this sort of patch something you'd consider for inclusion in the 1.0
branch? Or should we wait for 2.0 instead? If not, I'll make a Trac ticket
for the patch if needed. Additionally, I'd love to hear your suggestions on
configuring the Mako engine object for TG dynamically, without having to
update TG itself.

Cheers,

Filip de Waard

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Attachment: tg_improved_mako_support.diff
Description: Binary data

Reply via email to