[Zope] Help save my sanity (DTML-in string comparison)
Dieter Maurer
dieter@handshake.de
Tue, 19 Dec 2000 21:57:31 +0100 (CET)
Darin Lee writes:
> ... comparisons involving "id" do not work ...
"id" is particularly difficult in DTML.
For some objects, "id" is an attribute (a string),
for others, it is a method.
Due to Zope's acquisition magic, it is difficult
to compare method's to one another:
the "same" method compare different, if accessed on different
access paths.
Thus, you want to work with strings only.
The problem is: DTML does not let you test for types.
You can do something like this:
<dtml-with your_object>
<dtml-let id_name=id> <!-- now: "id_name" contains a string -->
<dtml-call "REQUEST.set('id_name',id_name)>
</dtml-let>
</dtml-with>
Dieter