[Zope-dev] Recursively adding ZClasses (continued)

Kevin Dangoor kid@kendermedia.com
Wed, 7 Jun 2000 11:43:11 -0400


----- Original Message -----
From: "Rik Hoekstra" <rik.hoekstra@inghist.nl>
To: <zope-dev@zope.org>
Sent: Wednesday, June 07, 2000 4:28 AM
Subject: [Zope-dev] Recursively adding ZClasses (continued)


> 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.

I'm using nested ZClasses in KM|Net News. Take a look at the AddArticle
method. In KMNN, these ZClasses are set up as nested ZClasses, so that may
change things somewhat. However, it may still work. Rather than doing
manage_addProduct[], you *might* be able to just directly call
ZClass_add(_.None, _), because it could be in your acquisition path at the
top of the product. In KMNN, that's all I had to do, but in that case the
ZClass_add method was located within the ZClass that was to contain it.

That sounded kind of rambling, so I hope it makes sense...

Kevin