Accessing the Mako Template Lookup Interface

38 views
Skip to first unread message

Vincent Catalano

unread,
Mar 19, 2013, 2:14:12 AM3/19/13
to pylons-...@googlegroups.com
Hello Pyramid community,

I was wondering if it's possible to get the Mako templates lookup interface from within a view callable. Looking at the mako_templating.py file in source I notice that there is an interface for adjusting Mako template file lookups as well as a get_template method (in order to account for packing naming conventions, etc.). Would it be possible to use this lookup object and how might I be able to access it so that I could call the get_template function?

Thanks for your help!

-Vincent


bard stéphane

unread,
Mar 23, 2013, 7:57:46 PM3/23/13
to pylons-...@googlegroups.com, Vincent Catalano
thank's vincent to give a coin on this subject
I've already submit a mail on this subject on 02/03, and didn't receive
any answer :/

for me, and after playing with pyramid, the template lookup
is create after the first call of mako renderer as a zca utility.
We cant' play with it before any view create him and can't
modify the way he is build

so ...
to complete template_lookup, I think that we don't have the choice
of completly write another mako module factory and overwrite template
renderer resolution as describe in the documentation.

that's a mess ...

Le 19/03/2013 07:14, Vincent Catalano a �crit :
> --
> You received this message because you are subscribed to the Google
> Groups "pylons-discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to pylons-discus...@googlegroups.com.
> To post to this group, send email to pylons-...@googlegroups.com.
> Visit this group at http://groups.google.com/group/pylons-discuss?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>

Vincent Catalano

unread,
Apr 1, 2013, 1:06:03 PM4/1/13
to pylons-...@googlegroups.com
Thanks for your reply, Bard!

I agree. In the end, I decided to create a new Mako module factory to use apart from Pyramid's template lookup interface. Michael Merickel gave me some good insight to this problem with his SO answer http://stackoverflow.com/questions/15509786/get-mako-template-from-within-pyramid-app-view, but, like you said, we still can't play with the Pyramid Mako factory until after the first view call.

I can understand the reasoning for the current implementation, however, it also would be nice to have a single Mako factory that can be accessed easily outside of views.

-Vincent


On Sat, Mar 23, 2013 at 4:57 PM, bard stéphane <stepha...@gmail.com> wrote:
thank's vincent to give a coin on this subject
I've already submit a mail on this subject on 02/03, and didn't receive
any answer :/

for me, and after playing with pyramid, the template lookup
is create after the first call of mako renderer as a zca utility.
We cant' play with it before any view create him and can't
modify the way he is build

so ...
to complete template_lookup, I think that we don't have the choice
of completly write another mako module factory and overwrite template
renderer resolution as describe in the documentation.

that's a mess ...

Le 19/03/2013 07:14, Vincent Catalano a écrit :
Hello Pyramid community,

I was wondering if it's possible to get the Mako templates lookup interface from within a view callable. Looking at the mako_templating.py file in source I notice that there is an interface for adjusting Mako template file lookups as well as a get_template method (in order to account for packing naming conventions, etc.). Would it be possible to use this lookup object and how might I be able to access it so that I could call the get_template function?

Thanks for your help!

-Vincent


--
You received this message because you are subscribed to the Google Groups "pylons-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pylons-discuss+unsubscribe@googlegroups.com.
To post to this group, send email to pylons-discuss@googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "pylons-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pylons-discuss+unsubscribe@googlegroups.com.
To post to this group, send email to pylons-discuss@googlegroups.com.



--
Vincent Catalano
Software Engineer and Web Ninja,
(520).603.8944
Reply all
Reply to author
Forward
0 new messages