Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
R
rp
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
14
Issues
14
List
Boards
Labels
Service Desk
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
La Quadrature du Net
rpteam
rp
Commits
f20c705f
Verified
Commit
f20c705f
authored
Sep 11, 2017
by
Thibaut Broggi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add RSS feed for international articles
parent
a88675d4
Pipeline
#1218
passed with stages
in 2 minutes and 8 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
2 deletions
+6
-2
apps/rp/feeds/feeds.py
apps/rp/feeds/feeds.py
+4
-1
apps/rp/feeds/urls.py
apps/rp/feeds/urls.py
+2
-1
No files found.
apps/rp/feeds/feeds.py
View file @
f20c705f
...
...
@@ -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
):
...
...
apps/rp/feeds/urls.py
View file @
f20c705f
...
...
@@ -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'
)
]
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment