[Zope] Comparing object values?

Paul Smith paul.smith@bristol.ac.uk
Tue, 24 Jul 2001 14:53:01 +0100


Dear all,

Stuck on something at the moment, which I hope you can shed some light on:

I'm trying to use a dependency in order to decide whether to print a value; 
the dependency being on the 'page' having an ID of index_html

Code snippet:

<dtml-unless expr="id=='index_html'">
<dtml-var id>
</dtml-unless>

This does not work - I'm assuming this is because ID is an object, rather 
than a string, and therefore not comparable. I've tried converting the 
object to a string, but this goofs and prints nothing to the screen:

<dtml-call "REQUEST.set('page_id', _.str(id))">
<dtml-var page_id>

but this deposits something like:

<Python Method object at 14c9990>

within the source, before I get anywhere near trying to make comparisons...

Anyone tell me what I am doing wrong?

Thanks,

Paul


------------------------------------------------------------------------------------------
Paul.Smith@bristol.ac.uk
Internet Development
Institute for Learning and Research Technology, http://www.ilrt.bris.ac.uk/
University of Bristol, 8-10 Berkeley Square,
Bristol BS8 1HH, UK Tel: +44 (0)117 928 7083, Fax: +44 (0)117 928 7112