allow creating pages filtered by tags

remotes/1726741609412457634/master
Andrew Engelbrecht 8 years ago
parent 4b23250e37
commit 44432a3b47
  1. 9
      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())

Loading…
Cancel
Save