[Zope] manage_afterAdd

Poor Yorick zope.org at pooryorick.com
Tue Mar 23 14:49:22 EST 2004


   > From: Chris Withers <lists at simplistix.co.uk>
   > Subject: Re: [Zope] manage_afterAdd
   > Sent: 22 Mar 2004 08:26:59
   >
   >  Well, you say you weren't successful, but you don't say what happened. So, what
   >  happened?!
   >  

The code I've listed below adds 'dbConnection' as a sibling of the newly instantiated "MyClass" object, but my goal is to have it added as a child.  So far my attempts have been unsuccesful.  Any suggestions?

class MyClass(mxmObjectManager.mxmObjectManager):
  'This is the doc string'

  meta_type='my fake meta type string'

  id='MyClassInstance'

  def __init__(self, id):
    mxmObjectManager.mxmObjectManager.__init__(self, id)

  def manage_afterAdd(self, containter=None, content=None):
    self.manage_addZMySQLConnection(
      id='dbConnection', title = 'dbConnection',
      connection_string = configFile.DbConnString)

  def manage_beforeDel(self, container=None, content=None):
    pass


def manage_addAction(self, id=PrinterSite.id, REQUEST=None):
  'Add instance to parentObjectManager'
  mxmObjectManager.addClass(self, id, PrinterSite, REQUEST)

Constructors = (mxmObjectManager.manage_addForm, manage_addAction,)


Thanks,

Poor Yorick
zope.org at pooryorick.com



More information about the Zope mailing list