[Zope] FW: [Zope] Checking for Property Presence
Loren Stafford
lstafford@icompression.com
Mon, 20 Dec 1999 12:36:48 -0800
-----Original Message-----
From: Loren Stafford [mailto:lstafford@icompression.com]
Sent: Monday, December 20, 1999 12:36
To: rgines@purina.com
Subject: RE: [Zope] Checking for Property Presence
<dtml-if hasProperty('pid')>...
Find this and more in http://www.zope.org/Members/ZQR
-- Loren
> -----Original Message-----
> From: zope-admin@zope.org [mailto:zope-admin@zope.org]On Behalf Of
> rgines@purina.com
> Sent: Monday, December 20, 1999 10:43
> To: zope@zope.org
> Subject: [Zope] Checking for Property Presence
>
>
>
> I think I backed myself into a little corner.
>
> I've got a directory with multiple DTML documents. They do not all have
> the same set of
> properties. I can pull the entire list fine, but everything that I have
> tried to do to select
> objects with a specific property fails on all of the DTML
> documents that do
> not have
> that property defined. I have been unable to find something equivalent
> to an
> 'if exists' type dtml tag which will check for the existence of a property
> without trying
> to check for a non-existent property value first.
>
> I am assuming that this is not rocket science but a mental block on my
> part.
>
> Any assistance would be appreciated ... the code snippet is included with
> the
> troubling line that I need ...
>
>
> <TABLE ALIGN="CENTER">
> <dtml-tree branches_expr="objectValues(['DTML Document'])">
> <dtml-if "AUTHENTICATED_USER.has_permission('View',REQUEST)">
> ==> <dtml-how do I check if the property exists "StaffLastName">
> <====
> <tr><td><A HREF="<dtml-var absolute_url>">
> <IMG SRC="<dtml-var icon>" BORDER=0></a></td>
> <td><dtml-var title_or_id></td>
> </dtml-if>
> </dtml-if>
> </dtml-tree>
> </TABLE>
>
>
> As a tangent, is there a way to define a new objectValue type
> within a Zope
> product
> without writing python source?
>
>
>
>
>
>
>
> _______________________________________________
> Zope maillist - Zope@zope.org
> 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 )
>