[Zope-dev] ZClass nesting/adding desperation

Rik Hoekstra rik.hoekstra@inghist.nl
Thu, 20 Apr 2000 09:43:19 +0200


This subject has come up in some form or another several times on the
mailing list and I have studied every piece of information I could lay my
hands upon, but I can't seem to grasp this.

I have a product with a number of nested ZClasses. This is a bit
unfortunate, but I want the Classes to only be addable from a specific
environment and not have them cluttering the addable objects tab in all
folders. As several people have remarked before, the contained classes do
not show up in the Subobjects tab (from a certain point onwards Object
Manager subclasses do not even show the tab anymore), but this can be
overcome by calling their factory methods directly.

Now if a ZCLass is contained in another ZClass this works well. But when the
ZCLasses are defined on the same level, or if an instance of the same ZClass
is to be added to an existing instance, this _will_not_work_. All juggling
with dtml-with and calling instances directly can't help this, they are
invariably added to the nearest parent folder object.

Now this forces me to revise the design of the product, and probably that
will solve the question and result in a better product. All the same. Is
there any guru out there who can explain what is happening and _why_. Or is
this a bug?

Rik