[Zope-dev] Want to test if User Equal to a Property

Shaw, Howard ShawH@STHS.org
Fri, 12 Mar 1999 11:40:39 -0600


I would expect that you need the single quotes. When you say _[object]
you are looking up the result of object. That is, if object is a
property containing the string 'test' then _[object] is identical to
_['test']. If you have a property "object" containing the string 'owner'
then you need to use _['object'] to evaluate to 'owner'. That is,
_['object']=='owner', while _[object]==_['owner'].

Good luck.
	----------
	From:  Jason Spisak [SMTP:webmaster@mtear.com]
	Sent:  Friday, March 12, 1999 7:21 AM
	To:  zope-dev@zope.org
	Subject:  [Zope-dev] Want to test if User Equal to a Property

	Zopsters,

	I am attempting to tailor the way information gets viewed based
on a
	person's login.  When the user get's to the page described by
the
	following code, I would like the page to look one way if the
'owner'
	property in the parent folder is equal to the user, and look the
other
	way if they are not equal.  The following code makes sense, but
does not
	work.

	<!--#var standard_html_header-->
	<!--#if expr="AUTHENTICATED_USER.getUserName()==_[owner]"-->
	  <!--#var candidate_edit-->
	<!--#else-->
	  <!--#var candidate_noedit-->
	<!--#/if-->
	<!--#var standard_html_footer-->

	The _[owner] property is stored as a string.  And
	AUTHERNTICAED_USER.getUserName() returns a string if I'm not
mistaken. 
	The look-up for _[owner] without single quotes is because I'm
not
	looking up an object, but a property, right? The document is a
DTML
	Method.  Do I have to reference the Parent in the lookup?

	All the best,

	Jason Spisak
	webmaster@mtear.com

	_______________________________________________
	Zope-Dev maillist  -  Zope-Dev@zope.org
	http://www.zope.org/mailman/listinfo/zope-dev

	(For non-developer, user-level issues, use the companion list,
	zope@zope.org, http://www.zope.org/mailman/listinfo/zope )