Commits

Morgan LEFIEUX committed 184ea0f

Correctif pour ajouter la date de publication dans les flux rss

Comments (0)

Files changed (1)

     def items(self):
         return Entry.objects.filter(is_public=True).order_by('-pub_date')[:10]
     
+    def item_title(self, obj):
+        return obj.title
+
+    def item_link(self, obj):
+        return obj.get_absolute_url()
+
+    def item_description(self, obj):
+        return obj.body
+
+    def item_pubdate(self, obj):
+        return obj.pub_date
+    
 class LatestComments(Feed):
     title = u'Gérard is a geek ! - Commentaires'
     link = '/'
     def items(self, obj):
         return Comment.objects.filter(is_public=True).order_by('-submit_date')[:10]
 
-    def item_link(self, object):
-		return object.get_absolute_url()
+    def item_link(self, obj):
+		return obj.get_absolute_url()
+    
+    def item_pubdate(self, obj):
+        return obj.submit_date
 
 class LatestPostsByTag(Feed):
-    title_template=('feeds/posts_title.html')
-    description_template=('feeds/posts_description.html')
-
     def get_object(self, request, monslug):
         return get_object_or_404(Tag, slug=monslug)
-
-    def items(self, obj):
-        return Entry.objects.filter(is_public=True).filter(tags__name=obj).order_by('-pub_date')[:10]
-
+    
     def title(self, obj):
         return u"Gérard is a geek ! - Catégorie %s" % (obj.name,)
 
     def link(self, obj):
         return obj.get_absolute_url()
 
-    def description(self, obj):
-        return u"Derniers billets"
+    description = u"Derniers billets"
+    title_template=('feeds/posts_title.html')
+    description_template=('feeds/posts_description.html')
+
+    def items(self, obj):
+        return Entry.objects.filter(is_public=True).filter(tags__name=obj).order_by('-pub_date')[:10]
+
+    def item_title(self, obj):
+        return obj.title
+
+    def item_link(self, obj):
+        return obj.get_absolute_url()
+
+    def item_description(self, obj):
+        return obj.body
+    
+    def item_pubdate(self, obj):
+        return obj.pub_date