Re-reading this, I realised I'd not provided much
information on the "repeat" problem, so I'm filling in
some gaps.

This works as I would expect:

<table border="1" width="80%">
  <tr tal:repeat="item context/items">
    <td tal:content="repeat/item/number">#</td>

i.e., if it is repeating over a property folder with
four objects in it, it produces a table headed
"Number" and with 4 further rows with numbers 1, 2, 3,
and 4 in.

However, as soon as I add any meat to it, e.g.:

<table border="1" width="80%">
  <tr tal:repeat="item context/items">
    <td tal:content="repeat/item/number">#</td>
    <td tal:content="item/Name">Name</td>

I get an error which shows up on the error log as:

"TypeError: tuple indices must be integers"

I have tried the second <td> element as all sorts:

    <td tal:content="item/name">Name</td>


    <td tal:content="item/title">Name</td>


    <td tal:content="item/getId">Name</td>


    <td tal:content="item/street">Name</td>
(all of the objects in the PropertyFolder have a
"street" attribute)

These all give the same error. Since my simple test
case works, it seems like I'm setting the loop up
correctly, but am asking for the data in the wrong way
later on. getId and title certainly look from the Zope
2.6 book like they should work, and I tried the rest
as "guesses". Where should I be looking to find the
correct information on how to do this in Zope 3?


> Hello,
> I'm building an application in Zope 3. I have a
> container object called a PropertyFolder, which
> holds
> Property objects.
> * Repeating over contained items.
> I'm trying to create a view which displays a list of
> all the Property objects in a property folder. I've
> tried doing this as described in the ZPT chapter of
> the Zope Book (2.6 edition), using a tal:repeat
> statement, but I can't seem to get it working. Has
> something changed in Zope 3? I've tried looking in
> the
> Zope 3 book, but none of the references to
> tal:repeat
> in there seem to be used for this type of thing.

How much free photo storage do you get? Store your holiday 
snaps for FREE with Yahoo! Photos http://uk.photos.yahoo.com
Zope maillist  -  Zope@zope.org
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-dev )

Reply via email to