The docs state all you all to do is define the description and date. This does not work. the descriptions and and dates are not output in the feed. Only the title. Does anyone know how to output the description and date? all help is greatly appreciated.
class NewsFeed(Feed):
title = "whatever"
link = "Whatever"
description = "myfeed"
def items(self):
return News.objects.all().order_by('-postdate')[:5]
def item_title(self, item):
return item.title
def item_description(self, item):
return item.summary
def item_pubdate(self, item):
return item.postdate
class News(models.Model):
title = whatever.....
url = whatever......
postdate = models开发者_Python百科.DateField(default=date.today)
summary = models.TextField(help_text="helptext")
To me this should work, however dates/descriptions are not output in Google Reader?
Im not too sure what the problem is here, some feeds work after 24 hours, I think google reader needs time to update itself, however some other feeds ive tried with other sites with the same code still dont work. strange. Some work some dont, same code? ill post when i find a more suitable answer, but the code above works in the majority of cases for most people.
精彩评论