feed knows how to print information about itself
This commit is contained in:
@ -28,5 +28,20 @@ class Feed(Base):
|
||||
self.html2textcontent = html2textcontent
|
||||
self.enabled = enabled
|
||||
|
||||
def __unicode__(self):
|
||||
id = self.id
|
||||
if self.feedinfo:
|
||||
title = self.feedinfo.title
|
||||
last = self.feedinfo.lastsuccessful
|
||||
else:
|
||||
title = '<unknown>'
|
||||
last = '<never>'
|
||||
entries = len(self.entry)
|
||||
url = self.url
|
||||
return u'%3d %s (%d entries, last fetched %s)\n %s' % (id, title, entries, last, url)
|
||||
|
||||
def __str__(self):
|
||||
return unicode(self).encode('utf-8')
|
||||
|
||||
def __repr__(self):
|
||||
return "<Feed('%s','%s','%s')>" % (self.url, self.daily, self.readability)
|
||||
return "<Feed('%d','%s')>" % (self.id, self.url)
|
||||
|
Reference in New Issue
Block a user