SciPost Code Repository
Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
SciPost
Manage
Activity
Members
Labels
Plan
Issues
118
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
SciPost
SciPost
Commits
cffb5725
Commit
cffb5725
authored
8 years ago
by
Jean-Sébastien Caux
Browse files
Options
Downloads
Patches
Plain Diff
Move to Atom1 feed instead of RSS2
parent
f817fa67
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
scipost/feeds.py
+5
-2
5 additions, 2 deletions
scipost/feeds.py
with
5 additions
and
2 deletions
scipost/feeds.py
+
5
−
2
View file @
cffb5725
from
django.contrib.syndication.views
import
Feed
from
django.contrib.syndication.views
import
Feed
from
django.utils.feedgenerator
import
Atom1Feed
from
django.core.urlresolvers
import
reverse
from
django.core.urlresolvers
import
reverse
from
comments.models
import
Comment
from
comments.models
import
Comment
class
LatestCommentFeed
(
Feed
):
class
LatestCommentFeed
(
Feed
):
title
=
"
SciPost Latest Comments
"
title
=
"
SciPost Latest Comments
"
subtitle
=
"
SciPost Latest Comments
"
link
=
"
/
"
link
=
"
/
"
feed_type
=
Atom1Feed
def
items
(
self
):
def
items
(
self
):
return
Comment
.
objects
.
filter
(
status__gte
=
0
).
order_by
(
'
-date_submitted
'
)[:
5
]
return
Comment
.
objects
.
filter
(
status__gte
=
0
).
order_by
(
'
-date_submitted
'
)[:
5
]
...
@@ -13,8 +16,8 @@ class LatestCommentFeed(Feed):
...
@@ -13,8 +16,8 @@ class LatestCommentFeed(Feed):
def
item_title
(
self
,
item
):
def
item_title
(
self
,
item
):
return
item
.
comment_text
[:
50
]
return
item
.
comment_text
[:
50
]
#
def item_
description
(self, item):
def
item_
subtitle
(
self
,
item
):
#
return item.
description
return
item
.
subtitle
def
item_link
(
self
,
item
):
def
item_link
(
self
,
item
):
if
item
.
commentary
:
if
item
.
commentary
:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment