[Zope-CMF] How to get Type in manage_afterAdd?

Jon Edwards jon@pcgs.freeserve.co.uk
Fri, 1 Feb 2002 00:35:53 -0000


>     if not hasattr(self, 'index.htm'):
>         addDocument(self, id = 'index.htm')
>
> so that it won't try to re-add the Document if it already exists.

Sorry, it was working! I was working on two files at once and testing the
wrong one :-)

But in case anyone is trying anything similar, you need aq_explicit in there
to stop it using acquisition and accidentally finding your id in a higher
folder -

  if not hasattr(self.aq_explicit, 'index.htm'):

Good how-to at ZopeLabs - http://www.zopelabs.com/cookbook/1001104105

Apologies

Cheers, Jon