[Zope] hard dtml syntax problem

Bill Anderson bill@libc.org
Thu, 13 Jul 2000 02:09:33 -0600


Jerome Alet wrote:
> 
> On Wed, 12 Jul 2000, ethan mindlace fremen wrote:
> 
> > Jerome Alet wrote:
> > >
> > > Hi want to call ZopeFind to find all folders in the current folder which
> > > doesn't have got any subfolder.
> > >
> > > the following query works but returns all folders, even those which have
> > > got subfolders:
> > >
> > > <dtml-let myresult="ZopeFind(this(), obj_metatypes=['Folder'],
> > > search_sub=1)">
> > > <dtml-in myresult>
> > > ...
> > > </dtml-in>
> >
> > Couldn't you just do a nested dtml-in?  It's kind of hacky, but...
> >
> > <dtml-in "objectValues(['Folder']">
> >  <dtml-in "objectValues(['Folder']">
> 
> No this can't help because I don't know how deep is my hierarchy: I've
> delegated folder creations to at least ten persons.

I'm confused. You said you only were concerned about the _current_
directory's subdirectories not having sub-directories, right? IOW You
have:

ROOT
 FolderA
  -FolderA1
  -FolderA2
   /FolderA2A
 FolderB
 FolderC

And in ROOT, you only want to see :
FolderB
FolderC

And in FolderA:
FolderA1

Right? If so, whether or not FolderA1 has subfolders is irrelevent in
root. The code ethan posted will provide you with that. I have very
similiar code for one of my nav-systems, opnly it is the opposite, I
show folders (and various other objects) and their subfolders (and
various other objects) only.

> 
> I'm sure I can do it with ZopeFind, because Zope do it in the Find
> (Advanced) tab, but don't know the exact syntax of:
> 
> """ obj_expr = "not objectValues(['Folder'])" """
> 
> (which doesn't work because of nested " and ')
> 
> Actually I've put a <dtml-if> inside of my <dtml-in> loop, but it limits
> my possibilities, especially because my result length is overestimated
> (all folders vs only folders with no subfolders).

Maybe I read it wrong, but I thought you said you wanted only folders
with subfolders _in the current directory_.

Maybe you need to rephrase your question?


Bill

-- 
"Linux: the operating system with a CLUE...
Command Line User Environment".

seen in a posting on comp.software.testing