Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
La Quadrature du Net
rpteam
Revue de Press
Commits
b0769099
Commit
b0769099
authored
Apr 18, 2019
by
Okhin
Browse files
More method documentation. Needs to find why there's a request body.
parent
bea08e7c
Pipeline
#2578
passed with stages
in 3 minutes and 10 seconds
Changes
2
Pipelines
1
Show whitespace changes
Inline
Side-by-side
apps/rp/api/views.py
View file @
b0769099
...
@@ -10,6 +10,26 @@ ArticleMixin = get_viewset_transition_actions_mixin(Article)
...
@@ -10,6 +10,26 @@ ArticleMixin = get_viewset_transition_actions_mixin(Article)
class
ArticleViewSet
(
ArticleMixin
,
viewsets
.
ModelViewSet
):
class
ArticleViewSet
(
ArticleMixin
,
viewsets
.
ModelViewSet
):
"""
list:
List all known articles in database.
create:
Create an article from its URL and inserts it with the
status NEW
read:
Get a specific article by id
update:
Change the content of an article
partial_update:
Change only some fields of an article
downvote:
Decrement the score of an article by one.
"""
queryset
=
Article
.
objects
.
all
()
queryset
=
Article
.
objects
.
all
()
serializer_class
=
ArticleSerializer
serializer_class
=
ArticleSerializer
...
...
apps/rp/models.py
View file @
b0769099
...
@@ -91,7 +91,7 @@ class Article(VoteMixin):
...
@@ -91,7 +91,7 @@ class Article(VoteMixin):
#: priority: True if article have priority
#: priority: True if article have priority
priority
=
models
.
BooleanField
(
default
=
False
)
priority
=
models
.
BooleanField
(
default
=
False
)
#:
L
ist of short tags to describe the article (eg
.
"Privacy", "Copyright")
#:
Comma separated l
ist of short tags to describe the article (eg
:
"Privacy", "Copyright")
.
tags
=
TaggableManager
(
blank
=
True
)
tags
=
TaggableManager
(
blank
=
True
)
class
Meta
:
class
Meta
:
...
...
Write
Preview
Supports
Markdown
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