Re: Maximum recursion depth using context in template

Carsten Agger <carstena-Lshci/D1eht/[email protected]>
Newsgroups gmane.comp.web.zope.plone.user
Organization Magenta ApS, http://www.magenta.dk
Message-ID <[email protected]>
Hi Dieter


On 03/26/2015 07:52 AM, dieter wrote:

> <ul id="extralinks"
>
>       tal:repeat="link root/site/links">
> ... ==> RuntimeError: maximal recursion exceeded ...
> What you are using above in the repeat is a so called "path expression".
>
> There are important differences between the Python expression
> "root.site.links" and the path expression "root/site/links".
> One of the most important difference is that an initial result
> of path expression evaluation is checked whether it is callable
> and in this case is called to give the final result.
> Calling something can have dramatic consequences, especially introduce
> a "maximal recursion exceeded" condition.
>
> Your options:
>
>    *  use the "nocall" type together with your path expression,
>       i.e. `...repeat="link nocall:root/site/links" ...`
>    
>    *  use the "python" type with a Python expression,
>       i.e. `...repeat="link python:root.site.links"...`
>
>
Thanks a lot! "python:root.site.links" did the trick!

I can learn something new every day, it seems. :-)

Best
/C

-- 
Carsten Agger
Magenta ApS
Incuba, Åbogade 15
DK-8200 Aarhus N

Tlf +45 3336 9699
Dir +45 5060 1476
Mob +45 2086 5010

http://www.magenta.dk
carstena-Lshci/D1eht/[email protected]


------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.