Commit 7bdbbcdc authored by Jocelyn Delalande's avatar Jocelyn Delalande

re-introduced basic rss feed refs #27

parent 891eb0f6
# -*- coding: utf-8 -*-
from texte.models import Texte
from django.contrib.syndication.views import Feed
from django.conf import settings
import settings
from texte.models import Texte
class RssTextes(Feed):
class DerniersTextesRSS(Feed):
title = "%s - Derniers textes" % settings.SITE_NAME
link = "/textes/"
description = u"Derniers textes publiés sur %s" % settings.SITE_NAME
categories = ['texte en ligne']
def items(self):
return Texte.objects.order_by('-pub_date')[:10]
def item_title(self, item):
return item.titre
def item_description(self, item):
return item.resume
def author_name(self, item):
if item:
return item.auteur
......@@ -4,8 +4,7 @@ from django.contrib.admin.views.main import *
from django.conf import settings
from django.contrib import auth, admin
from django.contrib.syndication.views import Feed
from syndication import RssTextes
from texte.feeds import DerniersTextesRSS
import tagging
import articles
......@@ -16,10 +15,6 @@ from bugreport.models import *
admin.autodiscover()
flux = {
'derniers-textes' : RssTextes,
}
urlpatterns = patterns('texte.views',
(r'^admin/([^/]+)/([^/]+)/(?P<id>.+)/compiler/$', 'compiler'),
(r'^admin/([^/]+)/([^/]+)/(?P<id>.+)/editeur/$', 'source_edit'),
......@@ -67,9 +62,8 @@ urlpatterns += patterns('django.views',
'slug_field':"name"}),
)
# Syndication rss
urlpatterns += patterns('django.contrib.syndication.views',
(r'^syndication/(?P<url>.*)/$', 'Feed',
{'feed_dict': flux}),
urlpatterns += patterns('',
(r'^abonnements/derniers-textes/rss/$', DerniersTextesRSS(),)
)
urlpatterns += patterns('texte.views',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment