[Zope] loadsite : how to detect object or attribute exist?

Oleg Broytmann Oleg Broytmann <phd@phd.fep.ru>
Thu, 21 Jun 2001 12:20:10 +0400 (MSD)


On Thu, 21 Jun 2001, Sin Hang Kin wrote:
> I want to modify loadsite to upload some database data to zope. However, I
> would like to detect the existing of the existing DTMLDocument and its
> attribute to prevent conflicts.

   To test if an object (actually, its ID) is in the folder, ask the list
of IDs:
   if "my_id" in folder.objectIds():...

   To test a property use object.hasProperty("p_id")

Oleg.
----
     Oleg Broytmann     http://www.zope.org/Members/phd/     phd@phd.pp.ru
           Programmers don't die, they just GOSUB without RETURN.