[ZPT] getting at properties from ZPT

Stephanie Benes stephanie at startspot.com
Thu Sep 30 16:31:16 EDT 2004


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>

This will display the following information:

<CompanyClass at 004> ('Biopharma', 'U.S.') 
<CompanyClass at 001> ('Big Pharma', 'Pharma', 'U.S.', 'Oncology',
'Neuroscience', 'Metabolic') 
<CompanyClass at 002> ('Biopharma', 'U.S.') 
<CompanyClass at 003> ('Big Pharma', 'Pharma', "Int'l", 'Oncology',
'Neuroscience', 'Metabolic') 
<CompanyClass at 005> ('Big Pharma', 'Oncology') 
<CompanyClass at 006>  

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.  

Any help or suggestions would be great!

Thanks.





More information about the ZPT mailing list