Le 29/06/2011 12:17, Damien Accorsi a écrit :
Le 29/06/2011 10:59, Alessandro Molina a écrit :


On Wed, Jun 29, 2011 at 9:57 AM, Damien Accorsi <[email protected]> wrote:

For the Genshi part, I use a lot of <py:def function="myFunctionWithParameters(bla,bla2,bla3...)"></py:def> which are called in loops of loops (that's why, I believe, it's not efficient).

I'm thinking about migrating to Mako if :
* I can't improve genshi performance
* I can't succeed in setting up chameleon.genshi

(I'd like not to migrate to mako as I like the way genshi guarantee the XML strucutre)


To be sure if ChameleonGenshi is enabled you can check if your app_globals have a chameleon_genshi_loader variable. If they do not have it then you didn't correctly install or enable Chameleon.
I believe this is not correctly enabled. I have the same problem with kajiki.

Here is the way I configure the template engine when not using genshi :

In app_cfg.py:

> base_config.renderers.append('chameleon_genshi')
> base_config.default_renderer = 'chameleon_genshi'

(idem for kajiki).

If I add the following code in the controller:
> from myproject.lib import app_globals
> print app_globals.chameleon_genshi_loader

then I get the following error:
AttributeError: 'module' object has no attribute 'chameleon_genshi_loader'

This is exactly the same for chameleon_genshi and for kajiki. Is there something else to configure ?! It looks like this is enough for mako to be used.
I finally "resetted" all my templates with mako.

My opinion about that choice :
+ I'm really happy with the speed;
+ I feel ok with the templating syntax (only developpers work on the application, even for the css/templating)
+ nothing special to setup in order to use in TG2.1
- I like the "full XML" style of Genshi, and the associated validation
- the syntax of mako is clearly for python dev.

Damien

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