Evan Simpson wrote:
>
>
> The only way (right now) to search for a property in the order PARENTS
> mentions them is to do so explicitly, by looping through the elements of
> PARENTS and checking their 'aq_explicit' for the property. Example Python
> snippet:
>
> for p in REQUEST['PARENTS']:
> if hasattr(p.aq_explicit, propname):
> return getattr(p, propname)
> raise AttributeError, propname
I think you might be missing an else: and a couple or three tabs. ;)
If I'm not wrong this should have a pretty elegant DTML equivalent:
<dtml-in PARENTS>
<dtml-with aq_explicit only>
<dtml-if propname>
<dtml-return proname>
<dtml-else>
<dtml-raise AttributeError><dtml-var propname></dtml-raise>
</dtml-if>
</dtml-with>
</dtml-in>
I'm not going to actually *test* it. Whether it works is left as an
exercise to the reader.
--
-Michel Pelletier
http://www.zope.org/Members/michel/MyWiki
Visit WikiCentral for the latest Zen:
http://www.zope.org/Members/WikiCentral
_______________________________________________
Zope maillist - [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
** No cross posts or HTML encoding! **
(Related lists -
http://lists.zope.org/mailman/listinfo/zope-announce
http://lists.zope.org/mailman/listinfo/zope-dev )