--- 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