[Zope] Subclassing ZObjectManager in ZClasses
Alexandre Ratti
alex@gabuzomeu.net
Thu, 16 Mar 2000 23:32:28 +0100
[Repost - previous message was truncated.]
Hello,
I've been playing with ZClasses and I ran into an issue with ZObjectManager.
Summary: (when creating a folderish ZClass and cascading base classes) if
ZObjectManager isn't subclassed at 1st level, objects can be added to the
folderish ZClass instances but they don't show in the manage_main object list.
[Zope 2.1.4 on Win32, pure ZClasses, no Python around]
More details:
1) I first tried this simple setup. It worked fine:
ZClass_for_CatalogAware
ZClass_for_Renderable
ZObjectManager
|
|_MyTestClass
MyTestClass is folderish and works as expected.
2) This setup worked fine too:
ZClass_for_CatalogAware
ZClass_for_Renderable
ZObjectManager
|
|_MyBaseClass
|_MyTestClass1
|_MyTestClass2
I can create a custom base class and use it in several ZClasses. They are
folderish and work as expected.
3) Then I tried this setup:
ZClass_for_CatalogAware
ZClass_for_Renderable
|
|_MyBaseClass
|_ZObjectManager
|_MyTestClass
Here I first created MyBaseClass, then I subclassed it together with
ZObjectManager when creating MyTestClass.
MyTestClass looked OK; I created a Content view linked to manage_main; I
allowed adding standard object types such as Folder and File.
However, when I add objects in an instance of MyTestClass they do not show
in the object list (Content view). I *think* they are actually added
because I cannot add an additional one with the same ID: I get an "ID
already in use" error.
When testing further I got the same results when CatalogAware and
Renderable were not around. Same results too when subclassing Folder instead.
It's not that bad, but I can't create a standard base class, then use it to
create a folderish variant.
Does anyone understand why?
Cheers.
Alexandre