[Zope-dev] Recursively adding ZClasses (continued)

Rik Hoekstra rik.hoekstra@inghist.nl
Wed, 7 Jun 2000 23:09:32 +0200


-----Original Message-----
From: Jason Spisak <444@hiretechs.com>
To: Rik Hoekstra <rik.hoekstra@inghist.nl>
Cc: Kevin Dangoor <kid@kendermedia.com>; zope-dev@zope.org
<zope-dev@zope.org>
Date: woensdag 7 juni 2000 22:26
Subject: Re: [Zope-dev] Recursively adding ZClasses (continued)


>Rik Hoekstra writes:
>
>> Thanks a lot Jason,
>>
>> I'll try it (though i'd swear I tried something very much alike)

It was very much alike, but you were right ;-).

The difference was that I did a

(sort of cut down pseudocode)

<dtml-with "manage_addProduct['ZECF']">
   <dtml-in obligatoryitems>
     <dtml-call "ZECItem_add(_['sequence-item'], REQUEST)">
   </dtml-in>
</dtml-with>


in which case the dtml-in interferes badly with the dtml-with

so turning it around to
<dtml-in obligatoryitems>
   <dtml-with "manage_addProduct['ZECF']">
     <dtml-call "ZECItem_add(_['sequence-item'], REQUEST)">
   </dtml-with>
</dtml-in>


which works.
So is this subtle or what ?! But at least it's consistent


>>
>> >
>> >This currently adds recursive ZClasses for me.  All ZClasses are on the
top
>> >level of the Product, no nesting:
>> >
>> >     <dtml-with "manage_addProduct['ZGL']">
>> >      <dtml-with
>> >"ComponentClass.createInObjectManager(_.getitem('unique_id', 1),
REQUEST)">
>>
>> hm, what is the 1 in the getitem argument doing there? Never used that
>> before...
>
>I am using it to render the document, not just get me the code.  The
>document is a DTMLMethod that renders a Zope install unique id based on the
>time.
>

Ah, yes. No need for that for me

>
>> >I cut a few things out that didn't have to do with the recursing, but
you
>> >bet the general picture.
>> >
>>
>>
>> Yes I bet it (sorry couldn't resist)
>>
>
>Yeah, like this is the most complex DTML you've ever seen.  ;)


Hm. You don't want me to send some of the clobbered stuff I put together
then. Still, I don't see how to do this in a cleaner way in a Python Method
(it will look cleaner, but the voodoo will be about the same unless I'm
badly mistaken).

Thanks (and Kevin also) for your help in sorting this out.

Rik