[Zope] manage_afterAdd

Poor Yorick ncconsulting at pooryorick.com
Fri Mar 19 15:42:40 EST 2004


   > From: Dragos Chirila <d.chirila at finsiel.ro>

   >   
   >  try like this:
   >   
   >  manage_addZMySQLConnection(self, id='dbConnection', title = 'dbConnection',
   >  connection_string = configFile.DbConnString)
   

(If this comes across as html, please let me know.  I have checked the "plain text" box in the web client that I am constrained to using from this location)

I'm not sure how Dragos meant for his suggestion to be implemented.  I've tried different permutations of my code below, and to date have not succeeded in getting the database connector added as a child of my newly-added class.  Here is my current code:


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,)





More information about the Zope mailing list