merge 3.6 default/stable stable
authorAurelien Campeas <aurelien.campeas@logilab.fr>
Fri, 12 Feb 2010 13:35:12 +0100
branchstable
changeset 4560 23e0632df615
parent 4556 43c14e0e8972 (current diff)
parent 4552 79f461d7ec37 (diff)
child 4564 38f0562b744b
merge 3.6 default/stable
--- a/web/formwidgets.py	Fri Feb 12 12:57:56 2010 +0100
+++ b/web/formwidgets.py	Fri Feb 12 13:35:12 2010 +0100
@@ -722,11 +722,14 @@
                 value = req.form[field.name]
             else:
                 value = self.typed_value(form, field)
-            try:
-                path, qs = value.split('?', 1)
-            except ValueError:
-                path = value
-                qs = ''
+            if value:
+                try:
+                    path, qs = value.split('?', 1)
+                except ValueError:
+                    path = value
+                    qs = ''
+            else:
+                path = qs = ''
             fqs = u'\n'.join(u'%s=%s' % (k, v) for k, v in req.url_parse_qsl(qs))
         attrs = dict(self.attrs)
         if self.setdomid:
--- a/web/views/treeview.py	Fri Feb 12 12:57:56 2010 +0100
+++ b/web/views/treeview.py	Fri Feb 12 13:35:12 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: