Anybody familiar with the <built-in> tag?
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="<built-in function id>/first_name" width=30 value=""></td></tr> <tr><th><built-in function id>/last name</th> <td><input name="<built-in function id>/last_name" width=30 value=""></td></tr> I am very curious what effect the <built in function id> tag has. I guess, 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 ever worked with <built-in> tag, please tell me/us how to handle it. Thx in advance, e-M
It's not a tag, but a default representation of a python method. To see what I mean, try typing 'str' at the python interpreter. 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. seb 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="<built-in function id>/first_name" width=30 value=""></td></tr> <tr><th><built-in function id>/last name</th> <td><input name="<built-in function id>/last_name" width=30 value=""></td></tr>
I am very curious what effect the <built in function id> tag has. I guess, 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 ever worked with <built-in> tag, please tell me/us how to handle it.
Thx in advance, e-M
Thank you Seb. 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? And as it is a DTML method for, I suppose that if I "embed it to" (call it 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. -----Original Message----- From: seb bacon [mailto:seb@jamkit.com] Sent: 2002. február 4. 18:34 To: emusty@mailbox.hu Cc: Zope Zope Listserver Subject: Re: [Zope] Anybody familiar with the <built-in> tag? It's not a tag, but a default representation of a python method. To see what I mean, try typing 'str' at the python interpreter. 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. seb 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="<built-in function id>/first_name" width=30 value=""></td></tr> <tr><th><built-in function id>/last name</th> <td><input name="<built-in function id>/last_name" width=30 value=""></td></tr>
I am very curious what effect the <built in function id> tag has. I guess, 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 ever worked with <built-in> tag, please tell me/us how to handle it.
Thx in advance, e-M
On Mon, 2002-02-04 at 17:48, e-Musty wrote:
Thank you Seb.
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?
And as it is a DTML method for, I suppose that if I "embed it to" (call it 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
-----Original Message----- From: seb bacon [mailto:seb@jamkit.com] Sent: 2002. február 4. 18:34 To: emusty@mailbox.hu Cc: Zope Zope Listserver Subject: Re: [Zope] Anybody familiar with the <built-in> tag?
It's not a tag, but a default representation of a python method.
To see what I mean, try typing 'str' at the python interpreter.
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.
seb
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="<built-in function id>/first_name" width=30 value=""></td></tr> <tr><th><built-in function id>/last name</th> <td><input name="<built-in function id>/last_name" width=30 value=""></td></tr>
I am very curious what effect the <built in function id> tag has. I guess, 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 ever worked with <built-in> tag, please tell me/us how to handle it.
Thx in advance, e-M
participants (2)
-
e-Musty -
seb bacon