[ZPT] Re: getting at properties from ZPT

Tonico Strasser contact_tonico at yahoo.de
Thu Sep 30 18:55:30 EDT 2004


Stephanie Benes wrote:
> Hi Folks - 
> 
> I'm trying to confirm whether or not a keyword exists in a multiple_select
> property called keywords in a class called Company from a ZPT page.  Not
> sure whether I'm trying to make ZPT do things that it can't. 
> 
> Here's what I've got:
> 
> <table>     
>      <span tal:repeat="cos python:root.Companies.objectValues(['Company'])"
> tal:omit-tag="">
>             <span tal:define="keys cos/keywords">
>              <tr> 
>               <td tal:content="cos">CompanyClass Object</td> 
>               <td tal:content="keys">Keywords</td>
>               <td tal:condition="python:keys=='Oncology'">The Oncology
> Keyword is Present</td>
>              </tr>
>             </span>
>      </span>
> </table>
> 
[...]
> What I'm trying to do (eventually) is get at all of the "Companies" in the
> Company class that have the keyword 'Oncology' in the keyword property.  
> 

In your example that would be:

   tal:condition="python:'Oncology' in keys"

Tonico



More information about the ZPT mailing list