[Zope] ObjectManager example needed

J. Cameron Cooper jccooper at jcameroncooper.com
Sun Nov 23 18:55:04 EST 2003


Andre Meyer wrote:

>I assume that I need a class MusicLibrary that is a direct subclass of
>ObjectManager and a variety of classes that represent my application
>classes and are all subclasses of ObjectManagerItem.
>
ObjectManagerItem is not a real class, and seems to have been invented 
for the documentation. You really want SimpleItem, I suspect.

>Do you agree with
>this? In the help about ObjectManager and ObjectManagerItem I miss a
>method like manage_addObject. There are only manage_self,
>manage_addProduct and manage_addFolder. But which method does the trick
>of adding Python objects to my product's folder?
>  
>
Zope asks each product to provide factories to add themselves. You get 
access to the registered factory methods (like manage_addFolder) with 
manage_addProduct.

http://www.zopelabs.com/cookbook/1012279676

mxmEasyProduct makes product bootstrap easier. mxmRelations may help 
your "links." But you might consider using CMF or Plone so that you can 
use Archetypes, which makes development of content types (which is 
really what you have) really dead easy. And it also provides some very 
nice reference machinery.

For finding objects in Zope where the amount or location is non-trivial, 
you will usually use ZCatalog.

       --jcc


-- 
"My point and period will be throughly wrought,
Or well or ill, as this day's battle's fought."





More information about the Zope mailing list