Deriving ZClasses from Other Product's ZClasses
Can you derive a ZClass in one product from a base class in another (separate) product? Suppose, for example, that you have a "library" product, i.e., one that is used to hold the base classes for a variety of other generic objects, such as people, organizations, and documents. Other products could use the "library" classes to derive new -specific- classes, such as employees (from people), clients (from organization), and templates (from documents). This way, multiple products could share objects with a common base class. Which begs the next question... Can you search for multiple classes by searching for the base class. E.g., there is a (base) people class, from which other classes, such as "contact," "employee," and others are based. I know you can find all the employee classes, and all the contact classes, but can you ask for the "people" class and get all of the classes that are either a people class or derived therefrom (e.g., employee, contact, etc.)? Ron
Ronald L. Chichester writes:
Can you derive a ZClass in one product from a base class in another (separate) product? In principle, this is possible.
However, there are rumors (--> searchable mailing list archives) that the inheritance breaks when the product is exported and later reimported. The reporter concluded: effectively unusable.
Which begs the next question...
Can you search for multiple classes by searching for the base class. There is no buildin for this. But it would be possible to define such a search mechanism.
You would use "ZopeFind" on the "Products" folder to locate all ZClasses and then look whether the sequence of bases contain the one you are searching for. Dieter
participants (2)
-
Dieter Maurer -
Ronald L. Chichester