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