diff options
-rw-r--r-- | lib/sqlalchemy/orm/interfaces.py | 6 | ||||
-rw-r--r-- | test/orm/query.py | 2 |
2 files changed, 7 insertions, 1 deletions
diff --git a/lib/sqlalchemy/orm/interfaces.py b/lib/sqlalchemy/orm/interfaces.py index abaeff49c..775892da1 100644 --- a/lib/sqlalchemy/orm/interfaces.py +++ b/lib/sqlalchemy/orm/interfaces.py @@ -369,6 +369,12 @@ class PropComparator(sql.ColumnOperators): def expression_element(self): return self.clause_element() + def desc(self): + return self.clause_element().desc() + + def asc(self): + return self.clause_element().desc() + def contains_op(a, b): return a.contains(b) contains_op = staticmethod(contains_op) diff --git a/test/orm/query.py b/test/orm/query.py index e01c0e67d..9a7a437da 100644 --- a/test/orm/query.py +++ b/test/orm/query.py @@ -196,7 +196,7 @@ class OperatorTest(QueryTest): def test_clauses(self): for (expr, compare) in ( (func.max(User.id), "max(users.id)"), - (desc(User.id), "users.id DESC"), + (User.id.desc(), "users.id DESC"), (between(5, User.id, Address.id), ":literal BETWEEN users.id AND addresses.id"), # this one would require adding compile() to InstrumentedScalarAttribute. do we want this ? #(User.id, "users.id") |