<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2800.1276" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>Thanks for you prompt reply.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>I tried calling in the meta type directly, but 
get:</FONT></DIV>
<DIV><STRONG>Error Value: global name 'Animal' is not defined</STRONG><BR><FONT 
face=Arial size=2>which is why I am using a slight work-around.</FONT></DIV>
<DIV><FONT face=Arial size=2>For the purpose of this z-class, it is necessary 
for me to use a multiple selection list, which I believe will not work properly 
with the <FONT face="Times New Roman">hasProperty function . Is there any other 
way to do it? Possibly iterating through the number of values which each 
instance holds for the multiple list? Am a bit stumped on the syntax 
though!</FONT></FONT></DIV>
<DIV><FONT size=2></FONT>&nbsp;</DIV>
<DIV><FONT size=2>Thanks,</FONT></DIV>
<DIV><FONT size=2></FONT>&nbsp;</DIV>
<DIV><FONT size=2>Ben</FONT></DIV>
<BLOCKQUOTE dir=ltr 
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
  <DIV style="FONT: 10pt arial">----- Original Message ----- </DIV>
  <DIV 
  style="BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: black"><B>From:</B> 
  <A title=toolkit@magma.ca href="mailto:toolkit@magma.ca">Small Business 
  Services</A> </DIV>
  <DIV style="FONT: 10pt arial"><B>To:</B> <A title=beninisrael@hotmail.com 
  href="mailto:beninisrael@hotmail.com">Ben</A> ; <A title=zope@zope.org 
  href="mailto:zope@zope.org">zope@zope.org</A> </DIV>
  <DIV style="FONT: 10pt arial"><B>Sent:</B> Thursday, December 18, 2003 12:34 
  AM</DIV>
  <DIV style="FONT: 10pt arial"><B>Subject:</B> Re: [Zope] (newbie)-Calling in 
  Multiple Selection from a Z-Class</DIV>
  <DIV><FONT face=Arial size=2></FONT><BR></DIV>
  <DIV><FONT size=2>If you used property fields to implement the 'hooves' (and 
  other) attributes, then you can use the hasProperty function to test if a 
  given instance has 'hooves'</FONT></DIV>
  <DIV>&nbsp;</DIV>
  <DIV><FONT size=2>eg.&nbsp; &lt;dtml-if 
  "animalinstance.hasProperty('hooves')"&gt;</FONT></DIV>
  <DIV>&nbsp;</DIV>
  <DIV><FONT size=2>Look in the API section of the Zope Book for more 
  info.</FONT></DIV>
  <DIV>&nbsp;</DIV>
  <DIV><FONT size=2>P.S.&nbsp;&nbsp; You can also check for meta types 
  directly:</FONT></DIV>
  <DIV>&nbsp;</DIV>
  <DIV><FONT size=2>&nbsp;&nbsp; &lt;dtml-in 
  "objectValues('Animal')"&gt;</FONT></DIV>
  <DIV>&nbsp;</DIV>
  <DIV>&nbsp;</DIV>
  <DIV><FONT size=2>HTH</FONT></DIV>
  <DIV>&nbsp;</DIV>
  <DIV><FONT size=2>Jonathan</FONT></DIV>
  <DIV>&nbsp;</DIV>
  <DIV>&nbsp;</DIV>
  <BLOCKQUOTE 
  style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
    <DIV style="FONT: 10pt arial">----- Original Message ----- </DIV>
    <DIV 
    style="BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: black"><B>From:</B> 
    <A title=beninisrael@hotmail.com 
    href="mailto:beninisrael@hotmail.com">Ben</A> </DIV>
    <DIV style="FONT: 10pt arial"><B>To:</B> <A title=zope@zope.org 
    href="mailto:zope@zope.org">zope@zope.org</A> </DIV>
    <DIV style="FONT: 10pt arial"><B>Sent:</B> December 17, 2003 5:13 PM</DIV>
    <DIV style="FONT: 10pt arial"><B>Subject:</B> [Zope] (newbie)-Calling in 
    Multiple Selection from a Z-Class</DIV>
    <DIV><BR></DIV>
    <DIV><FONT face=Arial size=2># I have a Z-Class called animals with a 
    multiple selection for animal_catagories</FONT></DIV>
    <DIV><FONT face=Arial size=2># I call in each member of the 
    Z-class:</FONT></DIV>
    <DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
    <DIV><FONT face=Arial size=2>&lt;dtml-with AnimalDirectory&gt;<BR>&nbsp; 
    &lt;dtml-in expr="objectValues()"&gt;<BR>&nbsp;&nbsp; &lt;dtml-if 
    "meta_type==' Animal"&gt;<BR></FONT></DIV>
    <DIV><FONT face=Arial size=2># For testing:</FONT></DIV>
    <DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
    <DIV><FONT face=Arial size=2>&lt;dtml-var id&gt; has &lt;dtml-var 
    animal_catagories&gt;</FONT></DIV>
    <DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
    <DIV><FONT face=Arial size=2># Which gives me "Horse is 
    ['hooved','brown','horsey'] as these are the values that I have given to the 
    horse instance</FONT></DIV>
    <DIV><FONT face=Arial size=2># I then have:</FONT></DIV><FONT face=Arial 
    size=2>
    <DIV><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;dtml-if 
    expr="REQUEST['hooved'] == 
    _['animal_categories'][0]"&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
    &lt;dtml-var id&gt; is a&nbsp; &lt;dtml-var 
    hooved&gt;&nbsp;animal<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
    &lt;/dtml-if&gt;<BR></FONT>&nbsp;</DIV>
    <DIV><FONT face=Arial size=2># Which gives me&nbsp; Horse is a hooved 
    animal. Which is great!</FONT></DIV>
    <DIV><FONT face=Arial size=2># Except this is only checking for the first 
    value. If hooved were the second value chosen in the multiple select list, 
    then this would not show. This is obvious because of the [0]</FONT></DIV>
    <DIV><FONT face=Arial size=2># What I am trying to do is to compare hooved 
    with each of the animal categories to see if it has been chosen. If I use a 
    &nbsp;&lt;dtml-in animal_catagories&gt; with or without ''s, then it tells 
    me that I can't call in a string.&nbsp;</FONT></DIV>
    <DIV><FONT face=Arial size=2># Could anyone please help me, or point me in 
    the right direction? </FONT></DIV>
    <DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
    <DIV><FONT face=Arial size=2>Thanks,</FONT></DIV>
    <DIV><FONT face=Arial size=2><BR>Ben</FONT></DIV>
    <DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
    <P>
    <HR>

    <P></P>_______________________________________________<BR>Zope 
    maillist&nbsp; -&nbsp; 
    Zope@zope.org<BR>http://mail.zope.org/mailman/listinfo/zope<BR>**&nbsp;&nbsp; 
    No cross posts or HTML encoding!&nbsp; **<BR>(Related lists - 
    <BR>&nbsp;http://mail.zope.org/mailman/listinfo/zope-announce<BR>&nbsp;http://mail.zope.org/mailman/listinfo/zope-dev 
    )<BR></BLOCKQUOTE></BLOCKQUOTE></BODY></HTML>