[Zope] newbie, accessing query results?

Dieter Maurer dieter at handshake.de
Mon Aug 25 23:14:48 EDT 2003


Daniel Tartaglia wrote at 2003-8-22 11:49 -0400:
 > I have the name of a file that I am passing into the page template 
 > using my_url?fileid="foo". I then want to access the properties of that 
 > file from within the zpt.
 > 
 > my zpt looks like:
 > <html>
 > <body tal:define="dentist here/REQUEST/fileid">
 > <span tal:replace="container/dentist/firstName">first_name</span>
 > <span tal:replace="container/dentist/lastName">last_name</span>
 > <br>
 > <span tal:replace="container/dentist/city">first name</span>
 > <br>
 > </body>
 > </html>
 > 
 > The error I get is:
 > Error Type: TypeError
 > Error Value: sequence index must be integer

Apparently, "container/dentist" is a property with a sequence value.
Therefore, "container/dentist/<something>" raises the above TypeError.

You should use: "container/?dentist/<something>".
This will evaluate "dentist" and use the result in the path
(e.g. "foo" instead of the constant "dentist").


Dieter



More information about the Zope mailing list