web/views/treeview.py
changeset 4552 79f461d7ec37
parent 4459 f628abfb3a6c
child 4719 aaed3f813ef8
--- a/web/views/treeview.py	Wed Feb 10 16:32:54 2010 +0100
+++ b/web/views/treeview.py	Thu Feb 11 12:18:46 2010 +0100
@@ -59,8 +59,12 @@
             self._init_headers(treeid, toplevel_thru_ajax)
             ulid = ' id="tree-%s"' % treeid
         self.w(u'<ul%s class="%s">' % (ulid, self.css_classes))
+        # XXX force sorting on x.sortvalue() (which return dc_title by default)
+        # we need proper ITree & co specification to avoid this.
+        # (pb when type ambiguity at the other side of the tree relation,
+        # unability to provide generic implementation on eg Folder...)
         for i, entity in enumerate(sorted(self.cw_rset.entities(),
-                                          key=lambda x: x.dc_title())):
+                                          key=lambda x: x.sortvalue())):
             if i+1 < len(self.cw_rset):
                 morekwargs['is_last'] = False
             else: