Package turbofeeds
[hide private]

Package turbofeeds

source code

TurboGears controller and widgets for feed handling.

Turbofeeds is a TurboGears 1 extension which provides support for generating RSS and Atom feeds and matching display widgets.

TurboFeeds was formerly the feed sub-package of the main TurboGears distribution. It was extracted from the TG core to ease updating, enhancing, and maintaining both projects.

TurboFeeds is mostly backwards-compatible with the turbogears.feed package, but has lots of fixes and a few new features, most importantly support for Genshi templates. It works with both the TurboGears 1.0 and the 1.1 branch.


To install TurboFeeds from the Cheeseshop use easy_install:

[sudo] easy_install TurboFeeds

This requires the setuptools package to be installed. If you have not done so already, download the script and run it to install setuptools.

If you want to get the latest development version, you can check out the trunk from the Subversion repository with:

svn co TurboFeeds

For bug reports and feature requests, please go to the TurboGears trac at

To open a ticket, you'll need a trac account. Please select "TurboFeeds" as the ticket component.



from turbogears import controllers, expose
from turbofeeds import FeedController, FeedHeadLinks, FeedLinks

class MyFeedController(FeedController):
    def get_feed_data(self, **kwargs):
        entries = []
        # Fill ``entries`` with dicts containing at least items for:
        #   title, link, summary and published
        # For example, supposing ``entry`` is a database object
        # representing a blog article:
            title = entry.title,
            author = dict(name =,
                email =,
            summary =[:30],
            published = entry.published,
            updated = entry.updated or entry.published,
            link = '' %
        return dict(entries=entries)

class Root(controllers.RootController):
    feed = MyFeedController(
        base_url = '/feed',
        title = "my fine blog",
        link = "",
        author = dict(name="John Doe", email=""),
        id = "",
        subtitle = "a blog about turbogears"
    feedlheadinks = FeedHeadLinks(controller=feed)
    feedlinks = FeedLinks(controller=feed,
        title = "Click link to access the feed in %(type)s format")

    def mypage(self):
        return dict(


  <h2>Feed links</h2>
  ${feedlinks('%(type)s feed', url_params=dict(format='full'))}


The TurboFeeds source is thoroughly documented with doc strings. The source distribution comes with epydoc-generated API documentation included.

You can also refer to the documentation for the original turbogears.feed package on the TurboGears documentation wiki:

All information on this page is also still valid for TurboFeeds, you just have to replace:

from turbogears.feed import FeedController


from turbofeeds import FeedController


Version: 0.2b

Submodules [hide private]