Hi, I am reading the chapter about ZPT (2.5, Chapter 5) and trying this table in a file named 'index_html': <table border="1" cellpadding="5" cellspacing="0"> <tbody> <tr> <td class="header">Name</td> <td class="header">Type</td> <td class="header">Size</td> <td class="header">Last Modified</td> </tr> <tr tal:repeat="item container/files"> <td><a href="Sample.tgz" class="filename" tal:attributes="href item/getId" tal:content="item/getId">Sample.tgz</a></td> <td tal:content="item/getContentType">application/x-gzip-compressed</td> <td tal:content="item/getSize">22 K</td> <td tal:content="item/bobobase_modification_time">2001/09/17</td> </tr> </tbody> </table> And this python script named 'files': return container.objectValues('File') This is the result when I test it: <table border="1" cellpadding="5" cellspacing="0"> <tbody> <tr> <td class="header">Name</td> <td class="header">Type</td> <td class="header">Size</td> <td class="header">Last Modified</td> </tr> </tbody> </table> So, actually, the tal:repeat table row has disappeared for some reason. But there are folders, page templates, python scripts etc. residing in it.. What can be wrong? --------------------------------------------------------------------------- "When a man sits with a pretty girl for an hour, it seems like a minute. But let him sit on a hot stove for a minute and it's longer than any hour. That's relativity." [A. Einstein, 1938] <footer align=left valign=bottom> http://weirdscience.nl </footer>
--On Montag, 11. November 2002 13:51 +0100 Blurg <blurg@gluipzak.nl> wrote:
Hi,
I am reading the chapter about ZPT (2.5, Chapter 5) and trying this table in a file named 'index_html':
<table border="1" cellpadding="5" cellspacing="0"> <tbody> <tr> <td class="header">Name</td> <td class="header">Type</td> <td class="header">Size</td> <td class="header">Last Modified</td> </tr> <tr tal:repeat="item container/files"> <td><a href="Sample.tgz" class="filename" tal:attributes="href item/getId" tal:content="item/getId">Sample.tgz</a></td> <td tal:content="item/getContentType">application/x-gzip-compressed</td> <td tal:content="item/getSize">22 K</td> <td tal:content="item/bobobase_modification_time">2001/09/17</td> </tr> </tbody> </table>
And this python script named 'files':
return container.objectValues('File')
This is the result when I test it:
<table border="1" cellpadding="5" cellspacing="0"> <tbody> <tr> <td class="header">Name</td> <td class="header">Type</td> <td class="header">Size</td> <td class="header">Last Modified</td> </tr> </tbody> </table>
So, actually, the tal:repeat table row has disappeared for some reason. But there are folders, page templates, python scripts etc. residing in it..
objectValues("File") only returns objects of type File in the container and *not* in subfolders...maybe that's your problem?! -aj
Yes, that was my problem, there were a bunch of objects in this directory, but not a 'File' object. hm, hm. Thanx in advance! Greetings Jurgen <cut>
objectValues("File") only returns objects of type File in the container and *not* in subfolders...maybe that's your problem?!
-aj </cut>
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
ZopeFind() is your friend to search in subfolders. -aj --On Montag, 11. November 2002 14:07 +0100 Blurg <blurg@gluipzak.nl> wrote:
Yes, that was my problem, there were a bunch of objects in this directory, but not a 'File' object. hm, hm.
Thanx in advance!
Greetings Jurgen
<cut>
objectValues("File") only returns objects of type File in the container and *not* in subfolders...maybe that's your problem?!
-aj </cut>
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
--------------------------------------------------------------------- - Andreas Jung http://www.andreas-jung.com - - EMail: andreas at andreas-jung.com - - "Life is too short to (re)write parsers" - ---------------------------------------------------------------------
participants (2)
-
Andreas Jung -
Blurg