# HG changeset patch # User Sandrine Ribeau <sandrine.ribeau@logilab.fr> # Date 1254779220 25200 # Mon Oct 05 14:47:00 2009 -0700 # Node ID c0004800f37588d50cc57e9c50af25197d52228f # Parent dbdedcedff5cfb7e484f44e54d5698863abb969e [views] ticket #343859, improved RSS view of a comment adding a link in the description to the entity the comment comments diff --git a/views.py b/views.py --- a/views.py +++ b/views.py @@ -319,3 +319,24 @@ 'WHERE C eid %(x)s', {'format' : format, 'text' : text, 'x' : comment}, 'x') + +# RSS view #################################################################### + +class RssItemCommentView(xmlrss.RSSItemView): + __select__ = implements('Comment') + + def cell_call(self, row, col): + entity = self.complete_entity(row, col) + self.w(u'<item>\n') + self.w(u'<guid isPermaLink="true">%s</guid>\n' + % xml_escape(entity.absolute_url())) + self.render_title_link(entity) + description = entity.dc_description(format='text/html') + \ + self.req._(u'about') + \ + u' <a href=%s>%s</a>' % (entity.root().absolute_url(), + entity.root().title) + self._marker('description', description) + self._marker('dc:date', entity.dc_date(self.date_format)) + self.render_entity_creator(entity) + self.w(u'</item>\n') +