[Zope] how to know if an object is an objectmanager
Pierre-Julien Grizel
grizel@mouli.net
Thu, 03 May 2001 12:29:28 +0200
Hi,
You can use the Python builtin issubclass :
ex :
if issubclass(object.__class__, ObjectManager):
xxx
Hope this helps,
Regards,
P.-J.
Jerome Alet wrote:
>
> Hi,
>
> I'm writing something generic in a python script which has to test if an
> object is an objectmanager or not, since I want it to work with Folders
> but also with user defined types which inherit from objectmanager.
>
> How can I do that ?
>
> thanks.
>
> Jerome Alet - alet@unice.fr - http://cortex.unice.fr/~jerome
> Fac de Medecine de Nice http://wwwmed.unice.fr
> Tel: (+33) 4 93 37 76 30 Fax: (+33) 4 93 53 15 15
> 28 Avenue de Valombrose - 06107 NICE Cedex 2 - FRANCE
>
> _______________________________________________
> 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 )
--
If the only tool you have is a hammer,
you tend to see every problem as a nail.
Si la unica herramita te tienes es un martillo,
tendras tendancia a ver cada problema como un clavo.
Wenn Ihnen als einziges Werkzeug ein Hammer zur Verfügung steht,
neigen Sie dazu, jedes Problem als Nagel zu betrachten.
Si le seul outil dont vous disposez est un marteau,
vous avez tendance à voir chaque problème comme un clou.
--Abraham Maslow