diff options
author | Sebastian Spaeth <Sebastian@SSpaeth.de> | 2013-01-07 11:15:04 +0100 |
---|---|---|
committer | Sebastian Spaeth <Sebastian@SSpaeth.de> | 2013-01-07 11:15:04 +0100 |
commit | 0efe9e2796b6feb722acd075218d934aff5e841e (patch) | |
tree | 9024e55d96e61b6416f1db851aa84dcb382ad583 /mediagoblin/db/sql/base.py | |
parent | 208842590c58349d45cf3176d6769717aa8cafb7 (diff) | |
download | mediagoblin-0efe9e2796b6feb722acd075218d934aff5e841e.tar.lz mediagoblin-0efe9e2796b6feb722acd075218d934aff5e841e.tar.xz mediagoblin-0efe9e2796b6feb722acd075218d934aff5e841e.zip |
Remove mediagoblin.db.sql.fake.DESCENDING
This is the last remnant that requires us to keep db.sql.fake.py. Use
ModelName.desc() or sqlalchemy.sql.expression.desc(column) to achieve
descending sorts.
Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
Diffstat (limited to 'mediagoblin/db/sql/base.py')
-rw-r--r-- | mediagoblin/db/sql/base.py | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/mediagoblin/db/sql/base.py b/mediagoblin/db/sql/base.py index 2dceca75..3530011e 100644 --- a/mediagoblin/db/sql/base.py +++ b/mediagoblin/db/sql/base.py @@ -18,9 +18,6 @@ from sqlalchemy.ext.declarative import declarative_base from sqlalchemy.orm import scoped_session, sessionmaker, object_session from sqlalchemy.orm.query import Query -from sqlalchemy.sql.expression import desc -from mediagoblin.db.sql.fake import DESCENDING - def _get_query_model(query): cols = query.column_descriptions @@ -29,10 +26,8 @@ def _get_query_model(query): class GMGQuery(Query): - def sort(self, key, direction): + def sort(self, key): key_col = getattr(_get_query_model(self), key) - if direction is DESCENDING: - key_col = desc(key_col) return self.order_by(key_col) |