From 44432a3b47254976f91d3299d97cb85c8161b54c Mon Sep 17 00:00:00 2001 From: Andrew Engelbrecht Date: Mon, 6 Mar 2017 14:46:43 -0500 Subject: [PATCH] allow creating pages filtered by tags --- mediagoblin_libreplanet/views.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/mediagoblin_libreplanet/views.py b/mediagoblin_libreplanet/views.py index 832ba14..1dac5be 100644 --- a/mediagoblin_libreplanet/views.py +++ b/mediagoblin_libreplanet/views.py @@ -21,8 +21,13 @@ from mediagoblin.tools.pagination import Pagination from mediagoblin.tools.response import render_to_response from mediagoblin.decorators import uses_pagination -def type_listing(media_type, title, request, page): - cursor = MediaEntry.query.\ +def type_listing(media_type, title, request, page, tag=None): + if (tag == None): + cursor = MediaEntry.query + else: + cursor = media_entries_for_tag_slug(request.db, tag) + + cursor = cursor.\ filter((MediaEntry.media_type == media_type) & (MediaEntry.state == u'processed')).\ order_by(MediaEntry.created.desc()) -- 2.25.1