Re: Maximum recursion depth using context in template
dieter <[email protected]>
| Newsgroups | gmane.comp.web.zope.plone.user |
|---|---|
| Message-ID | <[email protected]> |
Carsten Agger <carstena-Lshci/D1eht/[email protected]> writes: > I'm having a kind of weird problem with a viewlet template. > > We're inserting a list of custom links, specified by the customer, in > the header - like an extra menu. > > I want to configure this by having a folder containing only links in the > site root, i.e. accessible at "context/links". > > This exists and is iterable: > >>>> app.site.links > <ATFolder at /site/links> >>>> for l in app.site.links: > ... print l > ... > nyheder > partnerskaber > > I then insert code for generating it along with our customized search > box viewlet: > > <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"...` ------------------------------------------------------------------------------ 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/