[Zope] Newbie Zope Question

Darren Ehlers darren at clevermachine.com
Fri Sep 3 14:03:30 EDT 2004


Paul,

Thanks for responding.  I have verified that all properties exist on the
template and have values.  I also verified that it is returning what I
expect.  If I change all of the <td> rows to <td tal:content="item/title">,
it works fine.

Here is the error I receive:
Site Error

An error was encountered while publishing this resource.

Error Type: AttributeError
Error Value: targeted_release

Troubleshooting Suggestions

    * The URL may be incorrect.
    * The parameters passed to this resource may be incorrect.
    * A resource that this resource relies on may be encountering an error.

For more detailed information about the error, please refer to the error
log.

If the error persists please contact the site maintainer. Thank you for your
patience.  

-----Original Message-----
From: zope-bounces at zope.org [mailto:zope-bounces at zope.org] On Behalf Of Paul
Winkler
Sent: Friday, September 03, 2004 11:56 AM
To: zope at zope.org
Subject: Re: [Zope] Newbie Zope Question

On Fri, Sep 03, 2004 at 11:32:22AM -0600, Darren Ehlers wrote:
>  I am trying to build a table of properties for each object located in 
> a folder. I can get the objects OK, but it doesn't seem to be able to 
> pick the user-defined properties (although it does pick up the title 
> property just fine).
> 
> Here is the code. Why doesn't this work

Welcome!
First bit of advice: never just say "it doesn't work".  
That is almost never enough information for anyone to help.
Always describe the actual result; if there's an error, include the
traceback.

Your code should basically work. One suspicion:
 
> <tr tal:repeat="item container/objectValues">

That will include the page template itself.
Does it have all those properties?
If any object in the container is missing even one of those properties,
you'll get an AttributeError.

To make things more fault-tolerant, you can specify a fallback value, such
as the original content of the tag.
Something like this:

 <td class="style2" tal:content="item/coding | default">
   (coding: no value available)
 </td>


-- 

Paul Winkler
http://www.slinkp.com
_______________________________________________
Zope maillist  -  Zope at zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists -
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )




More information about the Zope mailing list