Esempio n. 1
0
    def get_item_value(self, resource, context, item, column, site_root):
        brain, item_resource = item
        if column == 'description':
            view = getattr(item_resource, 'tag_view',
                           getattr(item_resource, 'view'))
            if view:
                content = view.GET(item_resource, context)
                # set prefix
                prefix = site_root.get_pathto(item_resource)
                content = set_prefix(content, '%s/' % prefix, uri=context.uri)
                content = stream_to_str_as_xhtml(content)
                return content.decode('utf-8')
            else:
                return item_resource.get_property('description')

        return BaseRSS.get_item_value(self, resource, context, item,
                                      column, site_root)
Esempio n. 2
0
 def get_base_query(self, resource, context):
     query = BaseRSS.get_base_query(self, resource, context)
     tags_query = resource.parent.get_tags_query_terms(state='public',
             tags=[resource.name])
     query.extend(tags_query)
     return query