entity.py
branchstable
changeset 6258 9b5c008267b0
parent 6124 c5900230809b
child 6279 42079f752a9c
child 6307 c07763c59fcb
--- 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