aboutsummaryrefslogtreecommitdiffstats
path: root/mediagoblin/listings/views.py
diff options
context:
space:
mode:
Diffstat (limited to 'mediagoblin/listings/views.py')
-rw-r--r--mediagoblin/listings/views.py27
1 files changed, 22 insertions, 5 deletions
diff --git a/mediagoblin/listings/views.py b/mediagoblin/listings/views.py
index 01aad803..ca8e8229 100644
--- a/mediagoblin/listings/views.py
+++ b/mediagoblin/listings/views.py
@@ -47,7 +47,7 @@ def tag_listing(request, page):
{u'state': u'processed',
u'tags.slug': tag_slug})
cursor = cursor.sort('created', DESCENDING)
-
+
pagination = Pagination(page, cursor)
media_entries = pagination()
@@ -64,6 +64,7 @@ def tag_listing(request, page):
ATOM_DEFAULT_NR_OF_UPDATED_ITEMS = 15
+
def tag_atom_feed(request):
"""
generates the atom feed with the tag images
@@ -76,17 +77,33 @@ def tag_atom_feed(request):
cursor = cursor.sort('created', DESCENDING)
cursor = cursor.limit(ATOM_DEFAULT_NR_OF_UPDATED_ITEMS)
+ """
+ ATOM feed id is a tag URI (see http://en.wikipedia.org/wiki/Tag_URI)
+ """
feed = AtomFeed(
"MediaGoblin: Feed for tag '%s'" % tag_slug,
feed_url=request.url,
- url=request.host_url)
-
+ id='tag:'+request.host+',2011:gallery.tag-%s' % tag_slug,
+ links=[{'href': request.urlgen(
+ 'mediagoblin.listings.tags_listing',
+ qualified=True, tag=tag_slug ),
+ 'rel': 'alternate',
+ 'type': 'text/html'}])
for entry in cursor:
feed.add(entry.get('title'),
entry.get('description_html'),
+ id=entry.url_for_self(request.urlgen,qualified=True),
content_type='html',
- author=entry.uploader()['username'],
+ author={'name': entry.get_uploader.username,
+ 'uri': request.urlgen(
+ 'mediagoblin.user_pages.user_home',
+ qualified=True, user=entry.get_uploader.username)},
updated=entry.get('created'),
- url=entry.url_for_self(request.urlgen))
+ links=[{
+ 'href':entry.url_for_self(
+ request.urlgen,
+ qualified=True),
+ 'rel': 'alternate',
+ 'type': 'text/html'}])
return feed.get_response()