[Zope] ZClass Slection Property Question

tomc@evetcia.com tomc@evetcia.com
Fri, 20 Jul 2001 16:17:05 +1000


This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.

------_=_NextPart_001_01C110E3.995EEC00
Content-Type: text/plain;
	charset="iso-8859-1"

I am not the most experienced person at this so perhaps someone else will
offer better advice.

As far as I know you need to ensure two things.
1) that the property form can actually find the dtml list. i.e. the right
path/namespace
2) that the list is actually a list, by this I mean a python 
   list of the form ['item','item2']

I must say I have had trouble in the past getting dtml documents to return
true lists.

Unless you really need to use a dtml document/method, it may be easier to
use a 'lines' property in the same property sheet or the property sheet of
and object in its parent path. Then create a 'select' property and set it's
value to the name of the 'lines' property. I hope this makes sense. 

I have also found it easier to return a list from a python script.
A python script containing:

return ['item','anotheritem']

usually works too.

Tom

=> -----Original Message-----
=> From: Chris Bruce [mailto:chrisabruce@yahoo.com]
=> Sent: Friday, 20 July 2001 3:52 PM
=> To: tomc@evetcia.com
=> Cc: zope@zope.org
=> Subject: RE: [Zope] ZClass Slection Property Question
=> 
=> 
=> That did not seem to work.
=> 
=> 
=> --- tomc@evetcia.com wrote:
=> > The DTML method (in this case 'encoding') must return a 
=> list. I have
=> > had
=> > trouble doing this before. 
=> > 
=> > From my experience this will not work:
=> > 
=> > <dtml-return "['list', 'of', 'objects']">
=> > 
=> > because this seems to return a string that looks like a 
=> list, but not
=> > a true
=> > list.
=> > 
=> > I found the only way I could do this was:
=> > 
=> > <dtml-call "REQUEST.set('list',[])">
=> > <dtml-call "list.append('values')">
=> > ...
=> > <dtml-return list>
=> > 
=> > Tom
=> > 
=> > 
=> > 
=> > => -----Original Message-----
=> > => From: zope-admin@zope.org [mailto:zope-admin@zope.org]On 
=> > => Behalf Of Chris
=> > => Bruce
=> > => Sent: Friday, 20 July 2001 1:02 PM
=> > => To: zope@zope.org
=> > => Subject: [Zope] ZClass Slection Property Question
=> > => 
=> > => 
=> > => I have added a Selection property to a ZClass.  But I can't 
=> > => figure out
=> > => how to get the values to display.  I inserted "encoding" as the
=> > value
=> > => and added a DTML Method called "encoding".  Inside the dtml
=> > method, I
=> > => have:
=> > => 
=> > => HTML
=> > => Plain Text
=> > => 
=> > => But when I view the propertysheet, it says:
=> > => 
=> > => No value for encoding.
=> > => 
=> > => 
=> > => Any ideas on what I am doing wrong?  Additionally, is 
=> there a way
=> > to
=> > => populate a drop down box with a list of strings in a 
=> dtml method?
=> > => 
=> > => 
=> > => Thanks,
=> > => 
=> > => 
=> > => Chris 
=> > => 
=> > => __________________________________________________
=> > => Do You Yahoo!?
=> > => Get personalized email addresses from Yahoo! Mail
=> > => http://personal.mail.yahoo.com/
=> > => 
=> > => _______________________________________________
=> > => Zope maillist  -  Zope@zope.org
=> > => http://lists.zope.org/mailman/listinfo/zope
=> > => **   No cross posts or HTML encoding!  **
=> > => (Related lists - 
=> > =>  http://lists.zope.org/mailman/listinfo/zope-announce
=> > =>  http://lists.zope.org/mailman/listinfo/zope-dev )
=> > => 
=> > 
=> 
=> 
=> __________________________________________________
=> Do You Yahoo!?
=> Get personalized email addresses from Yahoo! Mail
=> http://personal.mail.yahoo.com/
=> 

------_=_NextPart_001_01C110E3.995EEC00
Content-Type: text/html;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; =
charset=3Diso-8859-1">
<META NAME=3D"Generator" CONTENT=3D"MS Exchange Server version =
5.5.2653.12">
<TITLE>RE: [Zope] ZClass Slection Property Question</TITLE>
</HEAD>
<BODY>

<P><FONT SIZE=3D2>I am not the most experienced person at this so =
perhaps someone else will offer better advice.</FONT>
</P>

<P><FONT SIZE=3D2>As far as I know you need to ensure two =
things.</FONT>
<BR><FONT SIZE=3D2>1) that the property form can actually find the dtml =
list. i.e. the right path/namespace</FONT>
<BR><FONT SIZE=3D2>2) that the list is actually a list, by this I mean =
a python </FONT>
<BR><FONT SIZE=3D2>&nbsp;&nbsp; list of the form =
['item','item2']</FONT>
</P>

<P><FONT SIZE=3D2>I must say I have had trouble in the past getting =
dtml documents to return true lists.</FONT>
</P>

<P><FONT SIZE=3D2>Unless you really need to use a dtml document/method, =
it may be easier to use a 'lines' property in the same property sheet =
or the property sheet of and object in its parent path. Then create a =
'select' property and set it's value to the name of the 'lines' =
property. I hope this makes sense. </FONT></P>

<P><FONT SIZE=3D2>I have also found it easier to return a list from a =
python script.</FONT>
<BR><FONT SIZE=3D2>A python script containing:</FONT>
</P>

<P><FONT SIZE=3D2>return ['item','anotheritem']</FONT>
</P>

<P><FONT SIZE=3D2>usually works too.</FONT>
</P>

<P><FONT SIZE=3D2>Tom</FONT>
</P>

<P><FONT SIZE=3D2>=3D&gt; -----Original Message-----</FONT>
<BR><FONT SIZE=3D2>=3D&gt; From: Chris Bruce [<A =
HREF=3D"mailto:chrisabruce@yahoo.com">mailto:chrisabruce@yahoo.com</A>]<=
/FONT>
<BR><FONT SIZE=3D2>=3D&gt; Sent: Friday, 20 July 2001 3:52 PM</FONT>
<BR><FONT SIZE=3D2>=3D&gt; To: tomc@evetcia.com</FONT>
<BR><FONT SIZE=3D2>=3D&gt; Cc: zope@zope.org</FONT>
<BR><FONT SIZE=3D2>=3D&gt; Subject: RE: [Zope] ZClass Slection Property =
Question</FONT>
<BR><FONT SIZE=3D2>=3D&gt; </FONT>
<BR><FONT SIZE=3D2>=3D&gt; </FONT>
<BR><FONT SIZE=3D2>=3D&gt; That did not seem to work.</FONT>
<BR><FONT SIZE=3D2>=3D&gt; </FONT>
<BR><FONT SIZE=3D2>=3D&gt; </FONT>
<BR><FONT SIZE=3D2>=3D&gt; --- tomc@evetcia.com wrote:</FONT>
<BR><FONT SIZE=3D2>=3D&gt; &gt; The DTML method (in this case =
'encoding') must return a </FONT>
<BR><FONT SIZE=3D2>=3D&gt; list. I have</FONT>
<BR><FONT SIZE=3D2>=3D&gt; &gt; had</FONT>
<BR><FONT SIZE=3D2>=3D&gt; &gt; trouble doing this before. </FONT>
<BR><FONT SIZE=3D2>=3D&gt; &gt; </FONT>
<BR><FONT SIZE=3D2>=3D&gt; &gt; From my experience this will not =
work:</FONT>
<BR><FONT SIZE=3D2>=3D&gt; &gt; </FONT>
<BR><FONT SIZE=3D2>=3D&gt; &gt; &lt;dtml-return &quot;['list', 'of', =
'objects']&quot;&gt;</FONT>
<BR><FONT SIZE=3D2>=3D&gt; &gt; </FONT>
<BR><FONT SIZE=3D2>=3D&gt; &gt; because this seems to return a string =
that looks like a </FONT>
<BR><FONT SIZE=3D2>=3D&gt; list, but not</FONT>
<BR><FONT SIZE=3D2>=3D&gt; &gt; a true</FONT>
<BR><FONT SIZE=3D2>=3D&gt; &gt; list.</FONT>
<BR><FONT SIZE=3D2>=3D&gt; &gt; </FONT>
<BR><FONT SIZE=3D2>=3D&gt; &gt; I found the only way I could do this =
was:</FONT>
<BR><FONT SIZE=3D2>=3D&gt; &gt; </FONT>
<BR><FONT SIZE=3D2>=3D&gt; &gt; &lt;dtml-call =
&quot;REQUEST.set('list',[])&quot;&gt;</FONT>
<BR><FONT SIZE=3D2>=3D&gt; &gt; &lt;dtml-call =
&quot;list.append('values')&quot;&gt;</FONT>
<BR><FONT SIZE=3D2>=3D&gt; &gt; ...</FONT>
<BR><FONT SIZE=3D2>=3D&gt; &gt; &lt;dtml-return list&gt;</FONT>
<BR><FONT SIZE=3D2>=3D&gt; &gt; </FONT>
<BR><FONT SIZE=3D2>=3D&gt; &gt; Tom</FONT>
<BR><FONT SIZE=3D2>=3D&gt; &gt; </FONT>
<BR><FONT SIZE=3D2>=3D&gt; &gt; </FONT>
<BR><FONT SIZE=3D2>=3D&gt; &gt; </FONT>
<BR><FONT SIZE=3D2>=3D&gt; &gt; =3D&gt; -----Original =
Message-----</FONT>
<BR><FONT SIZE=3D2>=3D&gt; &gt; =3D&gt; From: zope-admin@zope.org [<A =
HREF=3D"mailto:zope-admin@zope.org">mailto:zope-admin@zope.org</A>]On =
</FONT>
<BR><FONT SIZE=3D2>=3D&gt; &gt; =3D&gt; Behalf Of Chris</FONT>
<BR><FONT SIZE=3D2>=3D&gt; &gt; =3D&gt; Bruce</FONT>
<BR><FONT SIZE=3D2>=3D&gt; &gt; =3D&gt; Sent: Friday, 20 July 2001 1:02 =
PM</FONT>
<BR><FONT SIZE=3D2>=3D&gt; &gt; =3D&gt; To: zope@zope.org</FONT>
<BR><FONT SIZE=3D2>=3D&gt; &gt; =3D&gt; Subject: [Zope] ZClass Slection =
Property Question</FONT>
<BR><FONT SIZE=3D2>=3D&gt; &gt; =3D&gt; </FONT>
<BR><FONT SIZE=3D2>=3D&gt; &gt; =3D&gt; </FONT>
<BR><FONT SIZE=3D2>=3D&gt; &gt; =3D&gt; I have added a Selection =
property to a ZClass.&nbsp; But I can't </FONT>
<BR><FONT SIZE=3D2>=3D&gt; &gt; =3D&gt; figure out</FONT>
<BR><FONT SIZE=3D2>=3D&gt; &gt; =3D&gt; how to get the values to =
display.&nbsp; I inserted &quot;encoding&quot; as the</FONT>
<BR><FONT SIZE=3D2>=3D&gt; &gt; value</FONT>
<BR><FONT SIZE=3D2>=3D&gt; &gt; =3D&gt; and added a DTML Method called =
&quot;encoding&quot;.&nbsp; Inside the dtml</FONT>
<BR><FONT SIZE=3D2>=3D&gt; &gt; method, I</FONT>
<BR><FONT SIZE=3D2>=3D&gt; &gt; =3D&gt; have:</FONT>
<BR><FONT SIZE=3D2>=3D&gt; &gt; =3D&gt; </FONT>
<BR><FONT SIZE=3D2>=3D&gt; &gt; =3D&gt; HTML</FONT>
<BR><FONT SIZE=3D2>=3D&gt; &gt; =3D&gt; Plain Text</FONT>
<BR><FONT SIZE=3D2>=3D&gt; &gt; =3D&gt; </FONT>
<BR><FONT SIZE=3D2>=3D&gt; &gt; =3D&gt; But when I view the =
propertysheet, it says:</FONT>
<BR><FONT SIZE=3D2>=3D&gt; &gt; =3D&gt; </FONT>
<BR><FONT SIZE=3D2>=3D&gt; &gt; =3D&gt; No value for encoding.</FONT>
<BR><FONT SIZE=3D2>=3D&gt; &gt; =3D&gt; </FONT>
<BR><FONT SIZE=3D2>=3D&gt; &gt; =3D&gt; </FONT>
<BR><FONT SIZE=3D2>=3D&gt; &gt; =3D&gt; Any ideas on what I am doing =
wrong?&nbsp; Additionally, is </FONT>
<BR><FONT SIZE=3D2>=3D&gt; there a way</FONT>
<BR><FONT SIZE=3D2>=3D&gt; &gt; to</FONT>
<BR><FONT SIZE=3D2>=3D&gt; &gt; =3D&gt; populate a drop down box with a =
list of strings in a </FONT>
<BR><FONT SIZE=3D2>=3D&gt; dtml method?</FONT>
<BR><FONT SIZE=3D2>=3D&gt; &gt; =3D&gt; </FONT>
<BR><FONT SIZE=3D2>=3D&gt; &gt; =3D&gt; </FONT>
<BR><FONT SIZE=3D2>=3D&gt; &gt; =3D&gt; Thanks,</FONT>
<BR><FONT SIZE=3D2>=3D&gt; &gt; =3D&gt; </FONT>
<BR><FONT SIZE=3D2>=3D&gt; &gt; =3D&gt; </FONT>
<BR><FONT SIZE=3D2>=3D&gt; &gt; =3D&gt; Chris </FONT>
<BR><FONT SIZE=3D2>=3D&gt; &gt; =3D&gt; </FONT>
<BR><FONT SIZE=3D2>=3D&gt; &gt; =3D&gt; =
__________________________________________________</FONT>
<BR><FONT SIZE=3D2>=3D&gt; &gt; =3D&gt; Do You Yahoo!?</FONT>
<BR><FONT SIZE=3D2>=3D&gt; &gt; =3D&gt; Get personalized email =
addresses from Yahoo! Mail</FONT>
<BR><FONT SIZE=3D2>=3D&gt; &gt; =3D&gt; <A =
HREF=3D"http://personal.mail.yahoo.com/" =
TARGET=3D"_blank">http://personal.mail.yahoo.com/</A></FONT>
<BR><FONT SIZE=3D2>=3D&gt; &gt; =3D&gt; </FONT>
<BR><FONT SIZE=3D2>=3D&gt; &gt; =3D&gt; =
_______________________________________________</FONT>
<BR><FONT SIZE=3D2>=3D&gt; &gt; =3D&gt; Zope maillist&nbsp; -&nbsp; =
Zope@zope.org</FONT>
<BR><FONT SIZE=3D2>=3D&gt; &gt; =3D&gt; <A =
HREF=3D"http://lists.zope.org/mailman/listinfo/zope" =
TARGET=3D"_blank">http://lists.zope.org/mailman/listinfo/zope</A></FONT>=

<BR><FONT SIZE=3D2>=3D&gt; &gt; =3D&gt; **&nbsp;&nbsp; No cross posts =
or HTML encoding!&nbsp; **</FONT>
<BR><FONT SIZE=3D2>=3D&gt; &gt; =3D&gt; (Related lists - </FONT>
<BR><FONT SIZE=3D2>=3D&gt; &gt; =3D&gt;&nbsp; <A =
HREF=3D"http://lists.zope.org/mailman/listinfo/zope-announce" =
TARGET=3D"_blank">http://lists.zope.org/mailman/listinfo/zope-announce</=
A></FONT>
<BR><FONT SIZE=3D2>=3D&gt; &gt; =3D&gt;&nbsp; <A =
HREF=3D"http://lists.zope.org/mailman/listinfo/zope-dev" =
TARGET=3D"_blank">http://lists.zope.org/mailman/listinfo/zope-dev</A> =
)</FONT>
<BR><FONT SIZE=3D2>=3D&gt; &gt; =3D&gt; </FONT>
<BR><FONT SIZE=3D2>=3D&gt; &gt; </FONT>
<BR><FONT SIZE=3D2>=3D&gt; </FONT>
<BR><FONT SIZE=3D2>=3D&gt; </FONT>
<BR><FONT SIZE=3D2>=3D&gt; =
__________________________________________________</FONT>
<BR><FONT SIZE=3D2>=3D&gt; Do You Yahoo!?</FONT>
<BR><FONT SIZE=3D2>=3D&gt; Get personalized email addresses from Yahoo! =
Mail</FONT>
<BR><FONT SIZE=3D2>=3D&gt; <A HREF=3D"http://personal.mail.yahoo.com/" =
TARGET=3D"_blank">http://personal.mail.yahoo.com/</A></FONT>
<BR><FONT SIZE=3D2>=3D&gt; </FONT>
</P>

</BODY>
</HTML>
------_=_NextPart_001_01C110E3.995EEC00--