[Zope] DTML Document ids

Derek S. Wilson dwilson at abrazohealth.com
Fri Oct 17 19:19:35 EDT 2003


Are you putting this in a DTML Document, or a DTML Method? AFAIK, that
won't work unless it's in a method.

Thanks,
Derek Wilson


-----Original Message-----
From: Giuseppe Bonelli [mailto:giuseppe.bonelli at tiscali.it] 
Sent: Thursday, October 16, 2003 4:54 AM
To: zope at zope.org
Subject: RE: [Zope] DTML Document ids



> -----Original Message-----
> From: Andreas Jung [mailto:andreas at andreas-jung.com]
> Sent: giovedi 16 ottobre 2003 13.12
> To: giuseppe.bonelli at tiscali.it; zope at zope.org
> Subject: Re: [Zope] DTML Document ids
>
>
>
>
> --On Donnerstag, 16. Oktober 2003 13:04 Uhr +0200 Giuseppe Bonelli 
> <giuseppe.bonelli at tiscali.it> wrote:
>
> > Can someone explain to me why in the following code the
> line starting
> > with * outputs a null string and the line starting with **
> outputs the
> > correct id of the DTMLDocument object ?
> >
> > <dtml-var standard_html_header>
> > <dtml-in expr="objectItems('DTML Document')" prefix="sequence"> 
> > *<dtml-var "sequence_item.id"><br/>
>
> maybe because you haven't understand what the underscore namespace is 
> about.
>

maybe, but..

> Use <dtml-var "_['sequence-item'].id" >

... if I use the above I get an error (id does not exists as attribute
of the DTML Document istance) ...

>
> And btw. *never* access the ID of an object why with 'id'. You should 
> *ever* use obj.getId().

... and if I use:
<dtml-var "sequence_item.getId()"><br/>

I get the expected id.

Now, can you please elaborate a bit (or point me to some doc) on why I
should use the getId() method  instead of the id attribute? It happens
that I have exactly this bad habit and I have quite a lot of code where
I use id attributes :-(

Thank for the reply,

__peppo


_______________________________________________
Zope maillist  -  Zope at zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )



More information about the Zope mailing list