Use request.db to do a query to support a global-free view :)
authorChristopher Allan Webber <cwebber@dustycloud.org>
Wed, 3 Dec 2014 19:26:13 +0000 (13:26 -0600)
committerChristopher Allan Webber <cwebber@dustycloud.org>
Wed, 3 Dec 2014 21:40:58 +0000 (15:40 -0600)
mediagoblin/views.py

index 009e48e48b510edd54e1a840e60828b1236a78c3..9e893d566ba3cb11121e2d426cf84616f4bc964c 100644 (file)
@@ -25,7 +25,7 @@ from mediagoblin.decorators import uses_pagination, user_not_banned
 @user_not_banned
 @uses_pagination
 def default_root_view(request, page):
-    cursor = MediaEntry.query.filter_by(state=u'processed').\
+    cursor = request.db.query(MediaEntry).filter_by(state=u'processed').\
         order_by(MediaEntry.created.desc())
 
     pagination = Pagination(page, cursor)