[Zope-CMF] manage_afterAdd

Dieter Maurer dieter@handshake.de
Wed, 8 Jan 2003 22:48:12 +0100


Mark McEahern wrote at 2003-1-7 12:46 -0600:
 > I'm writing a portal type, subclassed from PortalContent and
 > DefaultDublinCoreImpl.  I'm overriding manage_afterAdd in order to validate
 > the instance's id (it must look like a date).  Do I need to explicitly set
 > the security on this method?  Is it implicitly private?
No, it inherits the security declarations of the base class.

 >   security.declarePrivate('manage_afterAdd')
 >   def manage_afterAdd(self, item, container):
 >     self._validate_id(item.getId())
Do not forget, to call the inherited "manage_afterAdd".
Otherwise, your objects will no longer automatically register
with "portal_catalog" (i.e. they are not automatically indexed/unindexed).

 > Similarly, are methods that begin with _ implicitly declared/treated as
 > private?
Yes.


Dieter