I'm using mako for my templating language and I noticed it has support
for filters, but what I would like to do with it is have a file that
contains all of my filters, and then just use them in the templates as
needed. Consolidating the template filters into one file seems
simpler as I don't keep
I think this is what you need
<%!
import myfilters
%>
Heres some tagged text: ${"text" | myfilters.tagfilter}
Jose
On Jul 14, 6:19 am, Scott Benjamin <[EMAIL PROTECTED]> wrote:
> I'm using mako for my templating language and I noticed it has support
> for filters, but what I would like to
Does that then mean that I must
<%!
import myfilters
%>
in every template file? Surely there is a way to put it in one
inherited template?
Scott
On Jul 17, 6:08 am, jose <[EMAIL PROTECTED]> wrote:
> I think this is what you need
>
> <%!
> import myfilters
> %>
>
> Heres some tagged te
There's a "mako.imports" template option for mako. In the times of
Myghty there was a setup that added additional "escapes" to Myghty in
config/environment.py, I ported it to Mako and use in my projects like
this:
tmpl_options['mako.imports'] = ['from webhelpers import auto_link as l',