I can't figure out how to write this simple expression. I am trying to compare 2 variable in a dtml-if statement.
---variables: username: <dtml-var username><br> AUTHENTICATED_USER: <dtml-var AUTHENTICATED_USER><br>
---output: username: dan AUTHENTICATED_USER: dan
---expression: <dtml-if "username == AUTHENTICATED_USER">
---evaluates false and I can't figure out why! Have also tried <dtml-if "username == REQUEST['AUTHENTICATED_USER']"> to no avail.
In the if expression you're using (username==ATHENTICATED_USER), you're comparing an object to a string. AUTHENTICATED_USER is a Zope object, not a string. You want: <dtml-if "username==AUTHENTICATED_USER.getUserName()">
Thanks again. This leads me to another question: Where can I find documentation for the objects methods and properties? Adam
In the if expression you're using (username==ATHENTICATED_USER), you're comparing an object to a string. AUTHENTICATED_USER is a Zope object, not a string.
You want:
<dtml-if "username==AUTHENTICATED_USER.getUserName()">
"Adam Gotheridge" <adam@foxvalley.net> wrote:
This leads me to another question: Where can I find documentation for the objects methods and properties?
you can find the doc's here: lib/python/AccessControl/User.py read the source, luke! thilo -- mezger@innominate.de innominate AG networking people fon: +49.30.308806-11 fax: -77 web: http://innominate.de pgp: /pgp/tm
participants (3)
-
Adam Gotheridge -
Chris McDonough -
news-list.zopeļ¼ innominate.de