|
|
@ -21,8 +21,13 @@ from mediagoblin.tools.pagination import Pagination |
|
|
|
from mediagoblin.tools.response import render_to_response |
|
|
|
from mediagoblin.tools.response import render_to_response |
|
|
|
from mediagoblin.decorators import uses_pagination |
|
|
|
from mediagoblin.decorators import uses_pagination |
|
|
|
|
|
|
|
|
|
|
|
def type_listing(media_type, title, request, page): |
|
|
|
def type_listing(media_type, title, request, page, tag=None): |
|
|
|
cursor = MediaEntry.query.\ |
|
|
|
if (tag == None): |
|
|
|
|
|
|
|
cursor = MediaEntry.query |
|
|
|
|
|
|
|
else: |
|
|
|
|
|
|
|
cursor = media_entries_for_tag_slug(request.db, tag) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
cursor = cursor.\ |
|
|
|
filter((MediaEntry.media_type == media_type) |
|
|
|
filter((MediaEntry.media_type == media_type) |
|
|
|
& (MediaEntry.state == u'processed')).\ |
|
|
|
& (MediaEntry.state == u'processed')).\ |
|
|
|
order_by(MediaEntry.created.desc()) |
|
|
|
order_by(MediaEntry.created.desc()) |
|
|
|