[entity] give ordermethod=None to fetch_rql to tell you don't want a specific order stable
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Thu, 16 Sep 2010 11:30:09 +0200
branchstable
changeset 6258 9b5c008267b0
parent 6257 7eb5f1aed728
child 6259 c3d98e4bee12
[entity] give ordermethod=None to fetch_rql to tell you don't want a specific order
entity.py
--- a/entity.py	Thu Sep 16 11:28:25 2010 +0200
+++ b/entity.py	Thu Sep 16 11:30:09 2010 +0200
@@ -223,9 +223,10 @@
                 destcls._fetch_restrictions(var, varmaker, destcls.fetch_attrs,
                                             selection, orderby, restrictions,
                                             user, ordermethod, visited=visited)
-            orderterm = getattr(cls, ordermethod)(attr, var)
-            if orderterm:
-                orderby.append(orderterm)
+            if ordermethod is not None:
+                orderterm = getattr(cls, ordermethod)(attr, var)
+                if orderterm:
+                    orderby.append(orderterm)
         return selection, orderby, restrictions
 
     @classmethod