[Zope] tree and dtml-with only not working for me

Andy Heath a.k.heath@open.ac.uk
Thu, 02 Mar 2000 16:58:04 +0000


Phil,

> Do all of the objects have a property 'rubbish'?

No, only some of them.  The problem goes away if
I make sure that every object has some value for
this property but that's not a good solution.  The
code you suggest (the dtml-if ...) is exactly what I intended
but on my system (Linux slackware 7 + zope  2.1.4) it finds
higher level rubbish properties.  Actually its not really
called rubbish, that's just what I was using to check
it worked before using it.

It simply doesn't work - if it works for you lets find
out what's different.  Are you on a windows platform?
What Zope version?

Just to restate the problem for new readers:-

The problem is to use "dtml-with X only" inside a tree rendering
so as to be able to test whether the current object
has some specific property.  The code works outside trees but
used in a tree it still seems to find properties by
acquisition.


> Try something like:
> 
> <dtml-with aq_explicit only>
>   <dtml-if rubbish><dtml-var rubbish><dtml-else>No Rubbish</dtml-if>
> </dtml-with>


This code finds "rubbish" at higher acquisition levels.  I know it
shouldn't but it does.  Anyone throw any light on it?


> 
> This should check that the rubbish property exists and change what gets
> rendered depending on that.
> 
> HTH
> 
> Phil
> phil.harris@zope.co.uk
> ----- Original Message -----
> From: "Andy Heath" <a.k.heath@open.ac.uk>
> To: "Phil Harris" <phil.harris@zope.co.uk>
> Cc: <zope@zope.org>
> Sent: Thursday, March 02, 2000 2:57 PM
> Subject: Re: [Zope] tree and dtml-with only not working for me
> 
> > Phil,
> >     nope.  Doesn't find the property called rubbish.
> >
> > Baffled.
> > Perhaps its an architecure-related bug -
> > I'm running on Linux, what box
> > are you on?
> >
> > Other ideas?
> >
> > Andy
> >
> > > Try this:
> > >
> > > <dtml-with aq_explicit only>
> > >   <dtml-var rubbish>
> > > </dtml-with>
> > >
> > > Works for me 8¬)
> > >
> > > Phil
> > > phil.harris@zope.co.uk
> > >
> > > ----- Original Message -----
> > > From: "Andy Heath" <a.k.heath@open.ac.uk>
> > > To: <zope@zope.org>
> > > Sent: 01 March 2000 13:27
> > > Subject: [Zope] tree and dtml-with only not working for me
> > >
> > > > There's something funny about this tree tag.
> > > >
> > > > When this code is inside a tree tag it doesn't
> > > > prevent acquisition.
> > > >
> > > > Code
> > > > ----
> > > > <dtml-with this only>
> > > >                          <dtml-var rubbish>
> > > > </dtml-with>
> > > >
> > > > What do I need to do to make this work - should it be
> > > > this.somethingOrOther?
> > > >
> > > > Also, anyone suggest what X I could put in
> > > > <dtml-var X>
> > > > to enable me to see something to help me figure out
> > > > what goes on with these namespace things
> > > >
> > > > Andy
> > > > Full code for the tree below
> > > >
> > > >
> > > >
> > > >
> > > >            <dtml-tree expr="lists" branches=objectValues sort=order>
> > > >
> > > >         <dtml-if "meta_type=='Folder'">
> > > >             <dtml-var title_or_id>
> > > >         <dtml-else>
> > > >             <dtml-if "kind=='discussion'">
> > > >                     <A HREF="<dtml-var listURL>">
> > > >                     <dtml-var title_or_id></A>
> > > >             <dtml-else>
> > > >
> > > > <dtml-with this only>
> > > >                          <dtml-var rubbish>
> > > > </dtml-with>
> > > >
> > > >
> > > >
> > > >             </dtml-if>
> > > >         </dtml-if>
> > > >         <dtml-if listinfo>
> > > >             (<dtml-var listinfo>)
> > > >         </dtml-if>
> > > >
> > > > </dtml-tree>
> > > >
> > > > --
> > > > -------------------------------------------------
> > > > Andy Heath                    a.k.heath@open.ac.uk
> > > > The Open University           +44 (0) 114 2885738
> > > >
> > > >
> > > > _______________________________________________
> > > > 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 )
> > > >
> >
> > --
> > -------------------------------------------------
> > Andy Heath                    a.k.heath@open.ac.uk
> > The Open University           +44 (0) 114 2885738
> >
> > _______________________________________________
> > 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 )
> >

-- 
-------------------------------------------------
Andy Heath                    a.k.heath@open.ac.uk
The Open University           +44 (0) 114 2885738