Francois-Regis CHALAOUX writes:
 > Hi,
 > 
 > When I create a ZClass instance from an external Method I create by default
 > the instance in the same place where is located my external method (see the
 > code below).
 > 
 > How to select a different place in my script where will be create the ZClass ?
 > 
 > ====
 > Code
 > ====
 > 
 > def addZClass(self,id,data):
 >    newob=self.Control.Panel.Products.MyProduct.MyClass(id)
 >    newob.id=id
 >    newob.propertysheets.Properties.manage_changeProperties(data)
 >    self._setObject(id,newob)
Here, you decide that the new object is placed into "self".

Use "self.whereever._setObject(id,newob)"
to place it in "whereever".
Of cause, "whereever" must be acquired by "self" for this to work.

You would use "getattr(self,wherever)", if "whereever" is not
a constant name but an expression, e.g. passed in via a parameter.



Dieter

_______________________________________________
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )

Reply via email to