Re: [Zope-dev] Recursively adding ZClasses (continued)

2000-06-07 Thread Jason Spisak

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)
> 
> 
>
>  
>
> 
> 
> 
> in which case the dtml-in interferes badly with the dtml-with
> 
> so turning it around to
> 
>
>  
>
> 
> 
> 
> 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:
> >> >
> >> > 
> >> >   >> >"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.

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )




Re: [Zope-dev] Recursively adding ZClasses (continued)

2000-06-07 Thread Rik Hoekstra


-Original Message-
From: Jason Spisak <[EMAIL PROTECTED]>
To: Rik Hoekstra <[EMAIL PROTECTED]>
Cc: Kevin Dangoor <[EMAIL PROTECTED]>; [EMAIL PROTECTED]
<[EMAIL PROTECTED]>
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)


   
 
   



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

so turning it around to

   
 
   



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


___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )




Re: [Zope-dev] Recursively adding ZClasses (continued)

2000-06-07 Thread Jason Spisak

Rik Hoekstra writes:

> Thanks a lot Jason,
> 
> I'll try it (though i'd swear I tried something very much alike)
> 
> >
> >This currently adds recursive ZClasses for me.  All ZClasses are on the top
> >level of the Product, no nesting:
> >
> > 
> >   >"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.


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

> thanks again, and i'll let you know if it works. It would be highly
> inconsistent if it would work from one product folder (a different from the
> current one) and not for the other (the current). So I think this deserves
> some more digging.

But it wouldn't totally suprize me.

All my best,

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.

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )




Re: [Zope-dev] Recursively adding ZClasses (continued)

2000-06-07 Thread Rik Hoekstra

Thanks a lot Jason,

I'll try it (though i'd swear I tried something very much alike)

>
>This currently adds recursive ZClasses for me.  All ZClasses are on the top
>level of the Product, no nesting:
>
> 
>  "ComponentClass.createInObjectManager(_.getitem('unique_id', 1), REQUEST)">

hm, what is the 1 in the getitem argument doing there? Never used that
before...


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

thanks again, and i'll let you know if it works. It would be highly
inconsistent if it would work from one product folder (a different from the
current one) and not for the other (the current). So I think this deserves
some more digging.

Rik


___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )




Re: [Zope-dev] Recursively adding ZClasses (continued)

2000-06-07 Thread Jason Spisak

Rik Hoekstra writes:

This currently adds recursive ZClasses for me.  All ZClasses are on the top
level of the Product, no nesting:




 
 
 
 
  
   
   

 
 
  

   
  
  
 
 

   
   
  
 
 





I cut a few things out that didn't have to do with the recursing, but you
bet the general picture.

All my best,


> 
> 
> Thanks for replying Kevin, but it won't work ;-( I tried it ALL, and it
> _will_not_work_. The nested ZClasses will apparently solve it (I used it
> elsewhere), but it will get you into trouble in other situations - if
> you want to add an instance of the nested zclass to an existing instance
> of that same nested zclass. I had to change my product before because of
> that.
> 
> > 
> > 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...
> 
> No matter if you use ZClass_add directly or in  dtml-with. No matter if
> you close the first dtml-with and open another. No matter if you
> redirect to get out of namespace problems (that will _really_ give
> strange errors). Believe me, it was a _very_ frustrating experience (and
> I really wanted to refrain from ranting -just couldn't help myself)
> 
> thanks again for replying
> 
> Rik
> 
> ___
> Zope-Dev maillist  -  [EMAIL PROTECTED]
> http://lists.zope.org/mailman/listinfo/zope-dev
> **  No cross posts or HTML encoding!  **
> (Related lists - 
>  http://lists.zope.org/mailman/listinfo/zope-announce
>  http://lists.zope.org/mailman/listinfo/zope )
> 


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.

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )




Re: [Zope-dev] Recursively adding ZClasses (continued)

2000-06-07 Thread Rik Hoekstra



Thanks for replying Kevin, but it won't work ;-( I tried it ALL, and it
_will_not_work_. The nested ZClasses will apparently solve it (I used it
elsewhere), but it will get you into trouble in other situations - if
you want to add an instance of the nested zclass to an existing instance
of that same nested zclass. I had to change my product before because of
that.

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

No matter if you use ZClass_add directly or in  dtml-with. No matter if
you close the first dtml-with and open another. No matter if you
redirect to get out of namespace problems (that will _really_ give
strange errors). Believe me, it was a _very_ frustrating experience (and
I really wanted to refrain from ranting -just couldn't help myself)

thanks again for replying

Rik

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )




Re: [Zope-dev] Recursively adding ZClasses (continued)

2000-06-07 Thread Kevin Dangoor

- Original Message -
From: "Rik Hoekstra" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
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:
>
> ( 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  "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


___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )




[Zope-dev] Recursively adding ZClasses (continued)

2000-06-07 Thread Rik Hoekstra

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:

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

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )