I'm a newbie zopista, and python for that matter...

In brief: I get a NameError when invoking "filter(...)" from DTML.  I thought this was 
a built-in python method, so I'm a bit puzzled.
In detail:

1) I want to display a dtml-tree of my folder hierarchy, but I want to exclude all 
Zwiki discussion groups.
2) In my index_html for the top level folder, I have the following:

<dtml-tree Outline leaves=dtcTemplate >
 <SPAN CLASS="tree">
  <dtml-if tree-item-expanded>
    <dtml-if expr="objectValues(['Folder'])">
    <IMG SRC="<dtml-var BASE2>/Outline/OpenBook.gif" ALIGN="TOP" BORDER="0">
    <I><dtml-var title></I>
    <dtml-if expr="objectValues(['Folder'])">
    <IMG SRC="<dtml-var BASE2>/Outline/ClosedBook.gif" ALIGN="TOP" BORDER="0">
    <dtml-var title>

which is cribbed straight from QuickStart.  

3) I only want to ignore Zwiki groups, but they are out-of-the-box folders, so I can't 
filter on meta-class.  
4) My approach is just to add a property to the Zwiki folder  ('blockTreeBranching')

5) In the dtml-tree tag, I change it to:

                branches_expr="filter( lambda f: not 
f.hasProperty('blockTreeBranching', false), objectValues(['Folder']) )">

which, all things equal, should DoTheRightThang.

6) The code can be published, but when I view it, it spits out a NameError, choking on 
"filter".  Argh.

Ideas gratefully recieved...


HyperSpace Ltd,Birmingham Research Park, Edgbaston, UK, B15 2SQ
(e) [EMAIL PROTECTED]           (t) +44 (0)121 414 7019

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

Reply via email to