[Zope] DTML documents as properties of python product classes
Keith Alperin
KAlperin@ignitemedia.com
Thu, 1 Mar 2001 11:37:01 -0600
This is a multi-part message in MIME format.
------_=_NextPart_001_01C0A276.38EEB3FD
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
OK, I think I see what you mean. When I go to Control Panel/Products/ ,
I can see a list of all of the installed products. It turns out that my
syntax error was caused by my text editor. It had inserted spaces
instead of tabs, so the last line of my method had improper indentation.
Everything works perfectly now.
Thanks so much for your help!!!!!
Keith
-----Original Message-----
From: Randall F. Kern [mailto:randy@spoke.net]=20
Sent: Wednesday, February 28, 2001 4:39 PM
To: Keith Alperin
Subject: RE: [Zope] DTML documents as properties of python
product classes
Was there a syntax error listed in the control panel's product list?
-Randy
-----Original Message-----
From: Keith Alperin [mailto:KAlperin@ignitemedia.com]
Sent: Wednesday, February 28, 2001 2:32 PM
To: Zope@zope.org
Subject: RE: [Zope] DTML documents as properties of python product
classes
Thank you so much for your response. Unfortunately, this didn't seem to
work. If I comment out the last line of the function (return
self.vote_results(self, self.REQUEST)) and restart Zope, then the
product loads successfully. I also tried the following variations:
return self.vote_results(self, REQUEST)
and
return self.vote_results(self)
neither seemed to work. Any more help that someone could provide would
be GREATLY appreciated.
Thanks again,
Keith
-----Original Message-----
From: Randall F. Kern [mailto:randy@spoke.net]
Sent: Monday, February 26, 2001 8:38 PM
To: Keith Alperin; Zope@zope.org
Subject: RE: [Zope] DTML documents as properties of python
product classes
That message probably means there is a syntax error. If you select your
product in the control panel, it will show you the details.
As for using the DTML document, you will need to call it at the end of
your function:
return self.vote_results(self, self.REQUEST)
-Randy
-----Original Message-----
From: Keith Alperin [mailto:KAlperin@ignitemedia.com]
Sent: Monday, February 26, 2001 5:51 PM
To: Zope@zope.org
Subject: [Zope] DTML documents as properties of python product classes
Greetings Zope folks. I am a bit of a newbie here and am attempting to
use a DTML document as a property of a class of a python product. To do
so, I have done the following (using the TutorialPoll as my example):
#...snip
vote_results =3D Globals.HTMLFile("vote_results", globals())
def castVote(self, choice):
"Votes for a choice"
vote_count =3D self.getVotesFor(choice)
self._votes[choice] =3D vote_count + 1
return self.vote_results
#the rest of my class
Upon restarting Zope, I get "(This object from the TutorialPoll product
is broken!)" next to my object in the management interface.
Any incite that any of you can provide would be most appreciated.
Thanks so much,
Keith R. Alperin
------_=_NextPart_001_01C0A276.38EEB3FD
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 =
6.0.4417.0">
<TITLE>RE: [Zope] DTML documents as properties of python product =
classes</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/plain format -->
<P><FONT SIZE=3D2>OK, I think I see what you mean. When I go to =
Control Panel/Products/ , I can see a list of all of the installed =
products. It turns out that my syntax error was caused by my text =
editor. It had inserted spaces instead of tabs, so the last line =
of my method had improper indentation. Everything works perfectly =
now.<BR>
<BR>
Thanks so much for your help!!!!!<BR>
<BR>
Keith<BR>
<BR>
<BR>
<BR>
-----Original Message-----<BR>
From: Randall F. Kern [<A =
HREF=3D"mailto:randy@spoke.net">mailto:randy@spoke.net</A>]<BR>
Sent: Wednesday, February 28, 2001 4:39 PM<BR>
To: Keith Alperin<BR>
Subject: RE: [Zope] DTML =
documents as properties of python product classes<BR>
<BR>
Was there a syntax error listed in the control panel's product list?<BR>
<BR>
-Randy<BR>
-----Original Message-----<BR>
From: Keith Alperin [<A =
HREF=3D"mailto:KAlperin@ignitemedia.com">mailto:KAlperin@ignitemedia.com<=
/A>]<BR>
Sent: Wednesday, February 28, 2001 2:32 PM<BR>
To: Zope@zope.org<BR>
Subject: RE: [Zope] DTML documents as properties of python product<BR>
classes<BR>
<BR>
<BR>
Thank you so much for your response. Unfortunately, this didn't =
seem to<BR>
work. If I comment out the last line of the function (return<BR>
self.vote_results(self, self.REQUEST)) and restart Zope, then the<BR>
product loads successfully. I also tried the following =
variations:<BR>
<BR>
return self.vote_results(self, REQUEST)<BR>
<BR>
and<BR>
<BR>
return self.vote_results(self)<BR>
<BR>
neither seemed to work. Any more help that someone could provide =
would<BR>
be GREATLY appreciated.<BR>
<BR>
Thanks again,<BR>
Keith<BR>
<BR>
<BR>
-----Original Message-----<BR>
From: Randall F. Kern [<A =
HREF=3D"mailto:randy@spoke.net">mailto:randy@spoke.net</A>]<BR>
Sent: Monday, February 26, 2001 8:38 PM<BR>
To: Keith Alperin; Zope@zope.org<BR>
Subject: RE: [Zope] DTML =
documents as properties of python<BR>
product classes<BR>
<BR>
That message probably means there is a syntax error. If you select =
your<BR>
product in the control panel, it will show you the details.<BR>
<BR>
As for using the DTML document, you will need to call it at the end =
of<BR>
your function:<BR>
return =
self.vote_results(self, self.REQUEST)<BR>
<BR>
-Randy<BR>
-----Original Message-----<BR>
From: Keith Alperin [<A =
HREF=3D"mailto:KAlperin@ignitemedia.com">mailto:KAlperin@ignitemedia.com<=
/A>]<BR>
Sent: Monday, February 26, 2001 5:51 PM<BR>
To: Zope@zope.org<BR>
Subject: [Zope] DTML documents as properties of python product =
classes<BR>
<BR>
<BR>
Greetings Zope folks. I am a bit of a newbie here and am =
attempting to<BR>
use a DTML document as a property of a class of a python product. =
To do<BR>
so, I have done the following (using the TutorialPoll as my =
example):<BR>
#...snip<BR>
vote_results =3D =
Globals.HTMLFile("vote_results", globals())<BR>
def castVote(self, choice):<BR>
"Votes for a =
choice"<BR>
vote_count =3D =
self.getVotesFor(choice)<BR>
self._votes[choice] =3D =
vote_count + 1<BR>
return self.vote_results<BR>
#the rest of my class<BR>
<BR>
<BR>
Upon restarting Zope, I get "(This object from the TutorialPoll =
product<BR>
is broken!)" next to my object in the management interface.<BR>
Any incite that any of you can provide would be most appreciated.<BR>
Thanks so much,<BR>
Keith R. Alperin<BR>
<BR>
</FONT>
</P>
</BODY>
</HTML>
------_=_NextPart_001_01C0A276.38EEB3FD--