entity.py
changeset 6279 42079f752a9c
parent 6142 8bc6eac1fac1
parent 6258 9b5c008267b0
child 6333 e3994fcc21c3
--- a/entity.py	Tue Sep 14 08:48:44 2010 +0200
+++ b/entity.py	Thu Sep 16 18:56:35 2010 +0200
@@ -222,9 +222,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