[Zope] Translating DTML into Python Script

Daniel Fairs daniel.fairs@spiderplant.net
Mon, 11 Jun 2001 15:32:29 +0100


The quotes thing is a legacy issue, I think... The following two are AFAIK
identical:

<dtml-in "MyPythonScript">
<dtml-in expr="MyPythonScript">

Removing the quotes causes Zope to call the object rather than just obtain a
reference to it (er, I think ;)

Dan

_________________________________________________________________
Daniel Fairs | daniel.fairs@spiderplant.net | www.spiderplant.net

> -----Original Message-----
> From: zope-admin@zope.org [mailto:zope-admin@zope.org]On Behalf Of
> Andreas Pauley
> Sent: 11 June 2001 13:32
> To: Erik Enge; Zope
> Subject: Re: [Zope] Translating DTML into Python Script
>
>
> It works now, thanks.
>
> It seems that with me trying everything I can think of,
> I have at some stage typed:
> <dtml-in "MyPythonScript">
>
> I can see now that there's a big difference between the quotes and the
> no-quotes version. I'm not sure exactly when you would use quotes and
> when not, but at least I'll know to look for something like this next
> time.
>
> Thanks again,
> Andreas.
>
> Erik Enge wrote:
> >
> > On Mon, 11 Jun 2001, Andreas Pauley wrote:
> >
> > > But when I try to loop through these results I get the
> following error:
> > >
> > > Error Type: AttributeError
> > > Error Value: __getitem__
> >
> > Try this for me:
> >
> > <dtml-in MyPythonScript>
> >   <dtml-var "_['sequence-item']">
> > </dtml-in>
> >
> > and look at what is returned.
>
>
> _______________________________________________
> 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 )
>
>