[Zope-dev] Recursively adding ZClasses (continued)

Rik Hoekstra rik.hoekstra@inghist.nl
Wed, 07 Jun 2000 10:28:28 +0200


Could someone help me understand adding adding ZClasses a bit further?

First I had a problem with nested ZClasses, which got me into trouble
when I wanted to add ZClasses to each other. So I followed the 'common
wisdom' of adding all ZClasses at the top level of the product. THis
generally works OK, and you can add ZClass instances to each other from
the management interface. So far so good. WHere things go wrong is by
recursively adding ZClasses, as in:

the following pseudo code for ParticularZClass with some NestedZClasses
inside:

(<Particular ZClass> constructor has the following action sequence):
create ParticularZClass instance
    set some properties
    in somelist
       set some other properties into REQUEST
       create NestedZClass instances
whatever

reading and following every piece of documentation I could get on this
(not much), I never got any further than adding the NestedZClasses
instances on the _same_ level as the ParticularZClass. No <dtml-with
"manage_addProduct['whatever']"> (which contrary to documentation should
have the containing product and not the ZClass as the 'whatever'
argument) could help me out.

The only workaround is to create the ZClass in an auxiliary product, in
which case the recursive adding does work.

Could someone explain what is happening here (apart from that it's a
bug)? 
And yes, I'll add it to the Collector.

Rik