Probably found!
I had to use "PageTemplateFile.expression_types"...

Regards,
Thierry

2015-01-25 13:36 GMT+01:00 Thierry Florac <[email protected]>:

> Hi,
> On the model of zope.contentprovider "provider:" TALES expression, I'm
> trying to register a new custom expression for Chameleon.
> My code is very simple and tries to follow Chamelon documentation:
>
> from chameleon import PageTemplate
>
> def provider_expression(string):
>     def compiler(target, engine):
>         return 'provider expression...'
>     return compiler
>
> PageTemplate.expression_types['provider'] = provider_expression
>
> The view is as simple:
>
> @view_config(name="page.html", context=MyApplication, renderer='page.pt')
> def main_page(request):
>     return {}
>
> And the template:
>
> <div tal:replace="provider:testManager">test</div>
>
> When the page is loaded, I always receive a "LookupError: Unknown
> expression type: 'provider'.".
>
> Any idea?
>
> Best regards,
> Thierry
>
>


-- 
http://www.imagesdusport.com -- http://www.ztfy.org

-- 
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 [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/pylons-discuss.
For more options, visit https://groups.google.com/d/optout.

Reply via email to