diff options
Diffstat (limited to 'mediagoblin/db/sql')
-rw-r--r-- | mediagoblin/db/sql/base.py | 7 | ||||
-rw-r--r-- | mediagoblin/db/sql/fake.py | 28 |
2 files changed, 1 insertions, 34 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) diff --git a/mediagoblin/db/sql/fake.py b/mediagoblin/db/sql/fake.py deleted file mode 100644 index 51c5127b..00000000 --- a/mediagoblin/db/sql/fake.py +++ /dev/null @@ -1,28 +0,0 @@ -# GNU MediaGoblin -- federated, autonomous media hosting -# Copyright (C) 2011, 2012 MediaGoblin contributors. See AUTHORS. -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see <http://www.gnu.org/licenses/>. - - -""" -This module contains some fake classes and functions to -calm the rest of the code base. Or provide super minimal -implementations. - -Currently: -- DESCENDING "constant" -""" - - -DESCENDING = object() # a unique object for this "constant" |