aboutsummaryrefslogtreecommitdiffstats
path: root/mediagoblin/listings
diff options
context:
space:
mode:
authorSebastian Spaeth <Sebastian@SSpaeth.de>2013-01-07 11:15:04 +0100
committerSebastian Spaeth <Sebastian@SSpaeth.de>2013-01-07 11:15:04 +0100
commit0efe9e2796b6feb722acd075218d934aff5e841e (patch)
tree9024e55d96e61b6416f1db851aa84dcb382ad583 /mediagoblin/listings
parent208842590c58349d45cf3176d6769717aa8cafb7 (diff)
downloadmediagoblin-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/listings')
-rw-r--r--mediagoblin/listings/views.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/mediagoblin/listings/views.py b/mediagoblin/listings/views.py
index 3064096c..80182124 100644
--- a/mediagoblin/listings/views.py
+++ b/mediagoblin/listings/views.py
@@ -14,8 +14,8 @@
# 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/>.
-from mediagoblin.db.util import media_entries_for_tag_slug, DESCENDING
-
+from mediagoblin.db.sql.models import MediaEntry
+from mediagoblin.db.util import media_entries_for_tag_slug
from mediagoblin.tools.pagination import Pagination
from mediagoblin.tools.response import render_to_response
from mediagoblin.decorators import uses_pagination
@@ -45,7 +45,7 @@ def tag_listing(request, page):
tag_slug = request.matchdict[u'tag']
cursor = media_entries_for_tag_slug(request.db, tag_slug)
- cursor = cursor.sort('created', DESCENDING)
+ cursor = cursor.order_by(MediaEntry.created.desc())
pagination = Pagination(page, cursor)
media_entries = pagination()
@@ -71,7 +71,7 @@ def tag_atom_feed(request):
tag_slug = request.matchdict[u'tag']
cursor = media_entries_for_tag_slug(request.db, tag_slug)
- cursor = cursor.sort('created', DESCENDING)
+ cursor = cursor.order_by(MediaEntry.created.desc())
cursor = cursor.limit(ATOM_DEFAULT_NR_OF_UPDATED_ITEMS)
"""