Mako templates with Deform

90 views
Skip to first unread message

pyramidX

unread,
Aug 22, 2014, 4:39:13 AM8/22/14
to pylons-...@googlegroups.com
I'm using Mako templates and have tried using Deform and it seems to work even though I haven't converted any widget templates to Mako from chameleon. Why is that? http://deform.readthedocs.org/en/latest/templates.html says "Optionally, convert all the existing Deform templates to your templating language of choice. This is only necessary if you choose to use the widgets that ship as part of Deform." but I am using the widgets that ship with Deform, so I'm not sure why it's working.

If I want to add a single new widget template and want to write it in Mako, does that mean I need to change ALL the widget templates? For example if I have a form with 10 field and I want to rewrite 1 of them, and I don't want to write it in chameleon, can I only rewrite that 1 widget or do I have to rewrite all 10?

Wichert Akkerman

unread,
Aug 22, 2014, 4:56:32 AM8/22/14
to pylons-...@googlegroups.com

On 22 Aug 2014, at 10:39, pyramidX <veeruk...@hotmail.com> wrote:

> I'm using Mako templates and have tried using Deform and it seems to work even though I haven't converted any widget templates to Mako from chameleon. Why is that?

I am guessing deform renders the widget templates itself, so the template language used for widgets is just an implementation detail that you never have to think about.

> http://deform.readthedocs.org/en/latest/templates.html says "Optionally, convert all the existing Deform templates to your templating language of choice. This is only necessary if you choose to use the widgets that ship as part of Deform." but I am using the widgets that ship with Deform, so I'm not sure why it's working.

That documentation might be wrong.

> If I want to add a single new widget template and want to write it in Mako, does that mean I need to change ALL the widget templates? For example if I have a form with 10 field and I want to rewrite 1 of them, and I don't want to write it in chameleon, can I only rewrite that 1 widget or do I have to rewrite all 10?

I’ld say no; you can probably choose the template tool to use per widget as part of its implementation.

Wichert.

Reply all
Reply to author
Forward
0 new messages