Got it! :) stories = {} collection_id=request.args(0) collection = db.collection[collection_id] or redirect(error_page) stories=db(db.story.collection.contains(collection_id)).select(orderby=db.story.title) length=len(stories); scheme = request.env.get('WSGI_URL_SCHEME', 'http').lower()
rss = rss2.RSS2(title=collection.title, link = scheme + '://' + request.env.http_host + request.env.path_info, description = collection.description, lastBuildDate = collection.modified_on, items = [ rss2.RSSItem(title = story.title, link = story.url, enclosure = rss2.Enclosure(story.audio_url, 0, 'audio/ mpeg'), description = story.description, comments = 'test', pubDate = story.date) for story in stories]) response.headers['Content-Type']='application/rss+xml' return rss2.dumps(rss)