[Zope] Using ObjectManager class

Bernd Dorn zope-mailinglist at mopa.at
Fri Mar 12 04:16:46 EST 2004


Serg wrote:
>>Serg wrote:
>>
>>><file min_all.py>
>>>....
>>>class min_all(SimpleItem.SimpleItem,ObjectManager):
>>>...
>>>manage_options=(ObjectManager.manage_options +
>>>                    ({'label':'Edit Minimal',
>>>'action':'manage_editMin_allForm'},
>>>                    ))
>>>......
>>>def addFoo(self,id,dn):
>>>        "add Foo object to min_all object"
>>>        O=Foo(id,dn)
>>>        self._setObject(id, O)
>>>        self._p_changed=1
>>>
>>>def delFoo(self,id):
>>>        "del Foo object from min_all object"
>>>        O=Foo(id,dn)
>>>        self._delObject(id)
>>>        self._p_changed=1
>>>
>>>Function delFoo and addFoo working normally. For example, I can't add
>>>second Foo object with existing id, and I can't del Foo object with not
>>>existing id.
>>>But I can't see objects on ObjectManager.manage_options tab! I see only
>>>message: "There are currently no items in min_all1".
>>>I think, that problem is in _getOb function of ObjectManager class....
>>>How can I change this function?
>>>
>>>And where can I read information about using ObjectManager class?
>>>
>>>Regards,
>>>Serg.
>>>
>>>
>>
>>does Foo inherit from SimpleItem or something equivalent? - this is
>>needed as far as i now
> 
> It's not importent for Foo class. I solve this problem. I change
> "class min_all(SimpleItem.SimpleItem,ObjectManager):"  to "class
> min_all(ObjectManager,SimpleItem.SimpleItem):". Now objects of min_all class
> see ObjectManager.ObjectItems first!
> 
> 
>>take a look at the source in lib/python/OFS/ObjectManager.py and
>>SimpleItem.py
> 
> Thanks :).
> Exists (UML) Class Diagramm for Zope Classes, like ObjectManager, SimpleItem
> _ etc? Where can I see this?

google for "zpydoc"

> 
> 
>>, bernd
> 
> 
> Regards,
> Serg.




More information about the Zope mailing list