--- a/entities/adapters.py Thu Jun 10 16:57:00 2010 +0200
+++ b/entities/adapters.py Thu Jun 10 16:57:02 2010 +0200
@@ -22,6 +22,7 @@
__docformat__ = "restructuredtext en"
from itertools import chain
+from warnings import warn
from logilab.mtconverter import TransformError
from logilab.common.decorators import cached
--- a/web/views/treeview.py Thu Jun 10 16:57:00 2010 +0200
+++ b/web/views/treeview.py Thu Jun 10 16:57:02 2010 +0200
@@ -184,7 +184,8 @@
def cell_call(self, row, col):
entity = self.cw_rset.get_entity(row, col)
- if entity.cw_adapt_to('ITree') and not entity.is_leaf():
+ itree = entity.cw_adapt_to('ITree')
+ if itree and not itree.is_leaf():
self.w(u'<div class="folder">%s</div>\n' % entity.view('oneline'))
else:
# XXX define specific CSS classes according to mime types
@@ -225,7 +226,7 @@
itree = entity.cw_adapt_to('ITree')
liclasses = []
is_open = self.open_state(entity.eid, treeid)
- is_leaf = not hasattr(entity, 'is_leaf') or itree.is_leaf()
+ is_leaf = itree is None or itree.is_leaf()
if is_leaf:
if is_last:
liclasses.append('last')