Add RSS feed for international articles

parent a88675d4
Pipeline #1218 passed with stages
in 2 minutes and 8 seconds
......@@ -7,8 +7,11 @@ class ArticlesFeed(Feed):
link = "/feed/"
description = "La revue de presse recense les articles de presse relatifs aux sujets de la Quadrature. Elle est compilée chaque jour par ses bénévoles, à partir de la presse francophone et internationale. Bonne lecture !"
def __init__(self, **kwargs):
self.filter_lang = kwargs['filter_lang']
def items(self):
return Article.objects.filter(lang="FR") \
return Article.objects.filter(lang=self.filter_lang) \
.order_by('-created_at')[:25]
def item_title(self, item):
......
......@@ -2,5 +2,6 @@ from django.conf.urls import url
from .feeds import ArticlesFeed
urlpatterns = [
url(r'^articles$', ArticlesFeed(), name='articles-feed'),
url(r'^$', ArticlesFeed(filter_lang='FR'), name='articles-feed'),
url(r'^international$', ArticlesFeed(filter_lang='EN'), name='articles-feed-international')
]
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