Hi again I have a brand new problem: I´ve created a new Zclass "NewsClass" that sublasses - ZObject - CatalogAwareBase (?) - ZFolder (?) - ZCatalogBase (?) - ZObjectManager where (?) means: I don´t know why I did this. Inside NewsClass I defined an other ZClass "SectionClass" which subclasses - ZObject - ZObjectManager - ZFolder (?) I will then define another class called "ArticleClass" that will probably have - ZObject - CatalogAwareBase 1) The problem is that when I´m on a NewsClass instance, I can´t get the select menu shows me the option "Add Sections". It does shows it if I move the factory to the same level of NewsClass but, of course, this makes "Sections" (almost) available from anywhere. 2) Having a newspaper as the obvious target, am I choosing the right base classes for it? Any ideas???
Pablo Ziliani writes: Your audience here would be happy if your posts had a non-empty Subject...
I have a brand new problem: I´ve created a new Zclass "NewsClass" that sublasses
- ZObject - CatalogAwareBase (?) - ZFolder (?) - ZCatalogBase (?) - ZObjectManager After you derive from "ZFolder", there is no need to derive from "ZObjectManager".
With high probability, "ZCatalogBase" already makes your ZClass folder-like. Therefore, no need to derive from "ZFolder". After you made your "NewsClass" a "Catalog", it is doubtful, that you make it "CatalogAware". Which catalog should be informed, when a "NewsClass" instance is created/deleted (that's the feature provided by "CatalogAware")? How can *you* decide which classes should be integrated? Each class provides some features. If you need the features, the class become a base candidate. If the same feature is provided by several classes, you will usually include only one of them.
where (?) means: I don´t know why I did this. You should!
Inside NewsClass I defined an other ZClass "SectionClass" which subclasses
- ZObject - ZObjectManager - ZFolder (?) You will use either "ZObjectManager" or "ZFolder", not both. "ZFolder" is an "ZObjectManager" which is in addition a "PropertyManager" and provides some additional tabs.
1) The problem is that when I´m on a NewsClass instance, I can´t get the select menu shows me the option "Add Sections". It does shows it if I move the factory to the same level of NewsClass but, of course, this makes "Sections" (almost) available from anywhere. There may be a HowTo at Zope.org. There definitely are threads in the (searchable) mailing list archives. Search for "nested ZClasses".
2) Having a newspaper as the obvious target, am I choosing the right base classes for it? I do not know, but:
* look at the available base classes and check what features they provide To do that, you will look at the corresponding Zope classes. E.g. "ZCatalogBase" provides the features of a "ZCatalog" for a ZClass, "ZObjectManager" provides the features of an "ObjectManager" for a ZClass, etc. * look at your task and decide what features you need * derive a list of candidate base classes * eliminate redundant classes from the list. Dieter
participants (2)
-
Dieter Maurer -
Pablo Ziliani