Skip to content

Commit

Permalink
Updated feeds.py to include published dates on Entry feeds. See http:…
Browse files Browse the repository at this point in the history
  • Loading branch information
lukeman committed Jul 3, 2008
1 parent c38be96 commit 36f7cc6
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions feeds.py
Expand Up @@ -13,6 +13,9 @@ class AllFeed(Feed):

def items(self):
return Entry.current.all().order_by('-pub_date')[:25]

def item_pubdate(self, item):
return item.pub_date



Expand All @@ -37,6 +40,9 @@ def description(self, obj):

def items(self, obj):
return obj.latest(qty=25)

def item_pubdate(self, item):
return item.pub_date



Expand All @@ -63,6 +69,9 @@ def items(self, obj):
return obj.latest()


def item_pubdate(self, item):
return item.pub_date


class AuthorFeed(Feed):
def get_object(self, bits):
Expand Down Expand Up @@ -90,6 +99,9 @@ def items(self, obj):
return obj.latest()


def item_pubdate(self, item):
return item.pub_date


class LanguageFeed(Feed):
def get_object(self, bits):
Expand All @@ -115,6 +127,10 @@ def description(self, obj):

def items(self, obj):
return obj.latest()


def item_pubdate(self, item):
return item.pub_date



Expand All @@ -139,6 +155,10 @@ def description(self, obj):

def items(self, obj):
return obj.latest()


def item_pubdate(self, item):
return item.pub_date



Expand All @@ -151,6 +171,10 @@ class TranslationFeed(Feed):

def items(self):
return Entry.objects.all().filter(**{'pub_date__lte': datetime.datetime.now()}).filter(**{'is_translation':True})


def item_pubdate(self, item):
return item.pub_date



Expand All @@ -175,6 +199,10 @@ class CommentFeed(Feed):

def items(self):
return Comment.objects.all().order_by('-date',)[:20]


def item_pubdate(self, item):
return item.date



Expand Down Expand Up @@ -205,3 +233,8 @@ def description(self, obj):

def items(self, obj):
return obj.comment_set.all().order_by('-date')


def item_pubdate(self, item):
return item.date

0 comments on commit 36f7cc6

Please sign in to comment.