[Zope] Anybody familiar with the <built-in> tag?

seb bacon seb@jamkit.com
04 Feb 2002 18:08:30 +0000


On Mon, 2002-02-04 at 17:48, e-Musty wrote:
> Thank you Seb.
>=20
> So you mean, the <built-in function id> literal in my DTML is kinda
> substitution of another code that calls the id() /or as you suggested,
> getId()/ method, donnu?
>=20
> And as it is a DTML method for, I suppose that if I "embed it to" (call i=
t
> from) various DTML documents, it will replace <built-in function id> with
> the name of the caller DTML document. Could it be possible? If it is so,
> it's a great feature in Zope.

No, it's nothing to do with zope or DTML.  The fact that python choses
to represent a function 'object' inside angle brackets just happens to
coincide with the fact that SGML tags use angle brackets.  The two facts
are unconnected, and what you are seeing is *not* a tag.  If you try my
example in the python interpreter, you will see that it's a feature of
the language, not of Zope:

>>> range
<built-in function range>
>>> range(0,10)
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]


seb

>=20
>=20
>=20
> -----Original Message-----
> From: seb bacon [mailto:seb@jamkit.com]
> Sent: 2002. febru=E1r 4. 18:34
> To: emusty@mailbox.hu
> Cc: Zope Zope Listserver
> Subject: Re: [Zope] Anybody familiar with the <built-in> tag?
>=20
>=20
> It's not a tag, but a default representation of a python method.
>=20
> To see what I mean, try typing 'str' at the python interpreter.
>=20
> In this case, id is a method.  In some Zope objects, id is a method
> (viz. id()) and in others a property.  To get round this, all objects
> should uniformly provide a getId() method.  so try getId instead of id
> in your code.
>=20
> seb
>=20
>=20
> On Mon, 2002-02-04 at 17:18, e-Musty wrote:
> > After creating a ZSearch interface for two ZSQL methods, I've realized
> that
> > the input form created by ZSearch contains something like follows:
> >
> > [we are within a form...]
> >     <tr><th><built-in function id>/first name</th>
> >         <td><input name=3D"<built-in function id>/first_name"
> >                    width=3D30 value=3D""></td></tr>
> >     <tr><th><built-in function id>/last name</th>
> >         <td><input name=3D"<built-in function id>/last_name"
> >                    width=3D30 value=3D""></td></tr>
> >
> > I am very curious what effect the <built in function id> tag has. I gue=
ss,
> > it is substituted by the id of the ZSQL method the form is currently
> > querying (keep in mind that the ZSearch made this one form for two ZSQL
> > methods). However I am not sure that my tips are good, if anyone has ev=
er
> > worked with <built-in> tag, please tell me/us how to handle it.
> >
> > Thx in advance,
> > e-M
> >
> >
> >
>=20
>=20
>=20
>=20
>=20
>=20