view Feed.py @ 32:500ba01e7f7a

TODO items
author Dirk Olmes <dirk@xanthippe.ping.de>
date Fri, 30 Apr 2010 06:02:06 +0200
parents 5bb57caa8f66
children aaec263f07ca
line wrap: on
line source


import FeedEntry

class Feed(object):
    @staticmethod
    def all(session):
        return session.query(Feed).order_by(Feed.title).all()
    
    def __init__(self, title, rss_url):
        self.title = title
        self.rss_url = rss_url

    def __repr__(self):
        return "<Feed (%d) %s>" % (self.pk, self.title)

    def userPresentableString(self):
        return self.title
    
    def entriesSortedByUpdateDate(self):
        sortedEntries = list(self.entries)
        sortedEntries.sort(FeedEntry.compareByUpdateDate)
        return sortedEntries