[Zope-dev] Recursively adding ZClasses (continued)

Jason Spisak 444@hiretechs.com
Wed, 07 Jun 2000 22:30:28 GMT


Rik Hoekstra:

Good to hear you got it.

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


Jason Spisak
CIO
HireTechs.com
6151 West Century Boulevard
Suite 900
Los Angeles, CA 90045
P. 310.665.3444
F. 310.665.3544

Under US Code Title 47, Sec.227(b)(1)(C), Sec.227(a)(2)(B) This email
address may not be added to any commercial mail list with out my
permission.  Violation of my privacy with advertising or SPAM will
result in a suit for a MINIMUM of $500 damages/incident, $1500 for
repeats.