[Zope] Dtml tags complexity [WAS : Re: [Zope] I seem to be missing a "break" DTML tag] DTML tag]

Pierre-Julien Grizel grizel@xlogx.com
Thu, 11 May 2000 02:30:52 +0200


Wow !! Thanks, Phil, this is the more "elegant" way to solve this problem ! 
I guess many of us have once been facing this problem, and your solution is
more "readable" than the other one.


By the way, is there a way to know the complexity of each dtml tag ? 
I mean, is a dtml-try more costly than waiting for the loop to complete (I
guess/hope it's not...) ? Is there a way to have such a piece of information
without having to set up large and tiring profiling techniques ?


Thanks for your help,


Regards,


P.-J.






Phil Harris wrote:
> 
> How about something like:
> 
> <sort of tested>
> 
> <dtml-try>
>     <dtml-call "REQUEST.set('topdown', [])">
>     <dtml-in PARENTS skip_unauthorized>
>         <dtml-if "_['sequence-item'].meta_type == 'Portal'">
>           <dtml-raise 'PortalFound>
>         >/dtml-if>
>         <dtml-call "topdown.insert(0, _['sequence-item'])">
>     </dtml-in>
> <dtml-except>
>     <dtml-comment>
>         Ignore the raised error, I'm only kidding
>     </dtml-comment>
> </dtml-in>
> 
> </sort of tested>
> 
> hth
> 
> Phil
> phil.harris@zope.co.uk
> 
> ----- Original Message -----
> From: "Mike Orr" <mso@sense-sea-MegaSub-1-220.oz.net>
> To: <zope@zope.org>
> Sent: 10 May 2000 19:19
> Subject: Re: [Zope] I seem to be missing a "break" DTML tag
> 
> > On Wed, May 10, 2000 at 11:56:07AM -0500, Dennis Nichols wrote:
> > > <dtml-call "REQUEST.set('topdown', [])">
> > > <dtml-in PARENTS skip_unauthorized>
> > >    <dtml-call "topdown.insert(0, _['sequence-item'])">
> > > </dtml-in>
> > >
> > > However, what I really want to do is quit reversing when I get up to a
> > > particular level, say the point at which I get to my Portal folder. I
> think
> > > I need to insert a line just before the </dtml-in> that says (untested
> :-)
> > >
> > >    <dtml-break "_['sequence-item'].meta_type == 'Portal'">
> >
> > A kludgey way would be to set a request variable meaning "not done"
> > before the loop, and put a dtml-if around your dtml-call to test
> > whether you're done.
> >
> > --
> > -Mike Orr, mso@mso.oz.net  -or-  mso@oz.net  (permanent: mso@jimpick.com)
> >    http://mso.oz.net/     English * Esperanto * Russkiy * Deutsch *
> Espan~ol
> >
> > _______________________________________________
> > Zope maillist  -  Zope@zope.org
> > http://lists.zope.org/mailman/listinfo/zope
> > **   No cross posts or HTML encoding!  **
> > (Related lists -
> >  http://lists.zope.org/mailman/listinfo/zope-announce
> >  http://lists.zope.org/mailman/listinfo/zope-dev )
> 
> _______________________________________________
> Zope maillist  -  Zope@zope.org
> http://lists.zope.org/mailman/listinfo/zope
> **   No cross posts or HTML encoding!  **
> (Related lists -
>  http://lists.zope.org/mailman/listinfo/zope-announce
>  http://lists.zope.org/mailman/listinfo/zope-dev )