<span class="gmail_quote"></span>I'm trying to list all the "files objects" in a folder with their metadata descriptions in a ZPT page thru written thru the ZMI.<br><div style="direction: ltr;"><br>I'm successfully accessing the metadata description of a single file with:
<br>
<br><p tal:replace="context/a_folder/a_file_in_a_folder/zope:description"></p><br><br>but when I try to iterate all the files I'm stuck with the correct syntax:<br><br><div tal:repeat="item context/a_folder">
<br> file:<p tal:replace="item">filename</p><BR> <!-- This line work correctly --><br> desc:<p tal:replace="item/zope:description">description</p><BR> <!-- this line create a system error -->
<br></div><br><br>Is there someone who can tell me the correct way to do this ?<br><br><br>
<div>
<pre>Traceback (innermost last):<br> Module zope.publisher.publish, line 138, in publish<br> result = publication.callObject(request, object)<br> Module zope.app.publication.zopepublication, line 164, in callObject
<br><br> return mapply(ob, request.getPositionalArguments(), request)<br> Module zope.publisher.publish, line 113, in mapply<br> return debug_call(object, args)<br> - __traceback_info__: <bound method ZPTPageEval.index
<br> of <zope.app.publisher.browser.viewmeta.ZPTPageEval object at 0x419cd3ac>><br> Module zope.publisher.publish, line 119, in debug_call<br> return object(*args)<br> Module zope.app.zptpage.browser.zptpage
, line 29, in index<br><br> return template.render(request, **kw)<br> Module zope.app.zptpage.zptpage, line 92, in render<br> sourceAnnotations=debug_flags.sourceAnnotations)<br> Module zope.pagetemplate.pagetemplate
, line 117, in pt_render<br><br> strictinsert=0, sourceAnnotations=sourceAnnotations)()<br> Module zope.tal.talinterpreter, line 270, in __call__<br> self.interpret(self.program)<br> Module zope.tal.talinterpreter
, line 345, in interpret<br>
handlers[opcode](self, args)<br> Module zope.tal.talinterpreter, line 837, in do_loop_tal<br> self.interpret(block)<br> Module zope.tal.talinterpreter, line 345, in interpret<br> handlers[opcode](self, args)<br>
Module zope.tal.talinterpreter, line 529, in do_optTag_tal<br> self.no_tag(stuff[-2], stuff[-1])<br> Module zope.tal.talinterpreter, line 511, in no_tag<br> self.interpret(program)<br> Module zope.tal.talinterpreter
<br>, line 345, in interpret<br> handlers[opcode](self, args)<br> Module zope.tal.talinterpreter, line 618, in do_insertText_tal<br> text = self.engine.evaluateText(stuff[0])<br> Module zope.app.pagetemplate.engine
, line 101, in evaluateText<br><br> text = self.evaluate(expr)<br> Module zope.tales.tales, line 698, in evaluate<br> return expression(self)<br> - /LocalWeb/index2.html<br> - Line 12, Column 7<br> - Expression: <PathExpr standard:u'item/zope:description'>
<br><br> - Names:<br> {'args': (),<br> 'container': <zope.app.folder.folder.Folder object at 0x41e54e6c>,<br> 'context': <zope.app.folder.folder.Folder object at 0x41e54e6c>,<br> 'default': <object object at 0x4039e488>,
<br><br> 'loop': {},<br> 'nothing': None,<br> 'options': {},<br> 'repeat': {},<br> 'request': <zope.publisher.browser.BrowserRequest instance URL=<a href="http://immocontrole.ca:8080/LocalWeb/index2.html" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
http://immocontrole.ca:8080/LocalWeb/index2.html</a>>,<br> 'template': <zope.app.zptpage.zptpage.ZPTPage object at 0x4200b92c>,<br> 'usage': <zope.pagetemplate.pagetemplate.TemplateUsage object at 0x41bc298c>}
<br><br> Module zope.tales.expressions, line 204, in __call__<br> return self._eval(econtext)<br> Module zope.tales.expressions, line 191, in _eval<br> ob = self._subexprs[-1](econtext)<br> Module zope.tales.expressions
<br>, line 123, in _eval<br> ob = self._traverser(ob, element, econtext)<br> Module zope.app.pagetemplate.engine, line 57, in zopeTraverser<br> request=request)<br> Module zope.app.traversing.adapters, line 177, in traversePathElement
<br><br> return traversable.traverse(nm, further_path)<br> Module zope.app.traversing.adapters, line 61, in traverse<br> raise TraversalError(subject, name)<br> - __traceback_info__: (<zope.app.pagetemplate.talesapi.ZopeTalesAPI
<br> object at 0x4203a48c>, 'description', [])<br>TraversalError: (<zope.app.pagetemplate.talesapi.ZopeTalesAPI object at 0x4203a48c>, 'description')<br></pre>
</div>
<br clear="all"><br>-- <br>Nicolas Legault<br>Recherche Et Développement<br>Immo Contrôle Inc<br>Tel: 514 272-3453 Ext 2<br>Fax: 514 272-3453
</div>