[Zope] Zope object Property name

Casey Duncan casey@zope.com
Tue, 13 Aug 2002 16:32:15 -0400


One possibility would be to use the meta_type. I would not write this in =
DTML=20
though, use a python script like:

for ob in context.objectValues():
    if ob.meta_type =3D=3D 'Folder':
       ..do folderish things..
    else:
       ..do non-folderish things..

Another possibility is checking for the attribute "isPrincipiaFolderish",=
 but=20
acquisition will likely get in your way with that, giving you false=20
positives. Supposably aq_explicit is the cure for this, but I have not fo=
und=20
it to be reliable:

for ob in context.objectValues():
    if getattr(ob.aq_explicit, 'isPrincipiaFolderish', 0):
       ..do folderish things..
    else:
       ..do non-folderish things..

YMMV ;^)

hth,

Casey

On Tuesday 13 August 2002 04:07 pm, Jason Wertz wrote:
> I'm a new at this so please bear with me...
>=20
> I'm using a dtml-in tag to iterate through a list returned by objectVal=
ues.=20
I want to look at each item and determine if it is a folder or a dtml-fil=
e=20
and execute a certain action based on that information. Only problem is, =
I=20
don't know what property holds that info and I've looked all over. Can=20
anybody help?=20
>=20
> Sorry if this is a dumb question but this is driving me nuts.=20
>=20
> Jason Wertz
> Senior Technology Specialist / WebMaster
> Delaware County Community College
> ph: 610-325-2771
> fax: 610-325-2820
> http://learn.dccc.edu/~jason
>=20
>=20
>=20
>=20
>=20
> _______________________________________________
> 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 )
>=20