Permalink
Browse files

Added event type to atom categories.

  • Loading branch information...
1 parent ae38b00 commit c726edcabaeb52f7f7d7ccd5864e4c5be419681d @DragonDM committed Dec 12, 2011
Showing with 6 additions and 4 deletions.
  1. +6 −4 yagi/serializer/atom.py
View
@@ -88,12 +88,13 @@ def dumps(entities, previous_page=None, next_page=None):
next_page_url=("%s?page=%s" % (_entity_url(), next_page)) \
if next_page is not None else None)
for entity in entities:
+ event_type=unicode(entity['event_type'])
feed.add_item(
title=unicode(entity['event_type']),
link=_entity_link(entity['id'], entity['event_type']),
- description=unicode(entity['event_type']),
+ description=event_type,
contents=entity['content'],
- categories=_categories())
+ categories=[event_type] + _categories())
return feed.writeString('utf-8')
@@ -114,10 +115,11 @@ def dump_item(entity):
previous_page_url=None,
next_page_url=None)
+ event_type=unicode(entity['event_type'])
feed.add_item(title=unicode(entity['event_type']),
link=_entity_link(entity['id'], entity['event_type']),
- description=unicode(entity['event_type']),
+ description=event_type,
contents=entity['content'],
- categories=_categories())
+ categories=[event_type] + _categories())
feed.write_item(handler, feed.items[0], root=True)
return outfile.getvalue()

0 comments on commit c726edc

Please sign in to comment.