make it more easy to override default branch state 3.5
authorAurelien Campeas <aurelien.campeas@logilab.fr>
Tue, 01 Sep 2009 16:55:45 +0200
branch3.5
changeset 3076 71ab8d47c57b
parent 3075 e9b7cd2e9012
child 3079 c1a4fbf2539a
make it more easy to override default branch state
web/views/treeview.py
--- a/web/views/treeview.py	Tue Sep 01 16:42:57 2009 +0200
+++ b/web/views/treeview.py	Tue Sep 01 16:55:45 2009 +0200
@@ -92,14 +92,15 @@
     (each item should be expandable if it's not a tree leaf)
     """
     id = 'treeitemview'
-    __select__ = EntityView.__select__ & implements(ITree) # XXX
+    default_branch_state_is_open = False
+    __select__ = EntityView.__select__ & implements(ITree)
 
     def open_state(self, eeid, treeid):
         cookies = self.req.get_cookie()
         treestate = cookies.get(treecookiename(treeid))
         if treestate:
             return str(eeid) in treestate.value.split(';')
-        return False
+        return self.default_branch_state_is_open
 
     def cell_call(self, row, col, treeid, vid='oneline', parentvid='treeview'):
         w = self.w