Skip to content
GitLab
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
e3b6ae39
Commit
e3b6ae39
authored
Apr 23, 2017
by
luxcem
Browse files
adds fields to article
parent
b659d5c1
Changes
4
Hide whitespace changes
Inline
Side-by-side
apps/core/management/__init__.py
0 → 100644
View file @
e3b6ae39
apps/core/management/commands/__init__.py
0 → 100644
View file @
e3b6ae39
apps/core/management/commands/init_groups.py
0 → 100644
View file @
e3b6ae39
from
django.core.management.base
import
BaseCommand
from
django.contrib.auth.models
import
Group
,
Permission
groups
=
[
"jedi"
,
"padawan"
]
permissions
=
{
"jedi"
:
[],
"padawans"
:
[]
}
class
Command
(
BaseCommand
):
help
=
"Adds initial groups for the application (jedi and padawans)"
def
handle
(
self
,
*
args
,
**
options
):
apps/rp/models/article.py
View file @
e3b6ae39
...
...
@@ -5,6 +5,13 @@ from .vote import UnDVotedMixin
from
newspaper
import
Article
as
ArticleParser
STATUS_CHOICES
=
(
(
"PENDING"
,
_
(
"Pending"
)),
(
"PUBLISHED"
,
_
(
"Published"
)),
(
"REJECTED"
,
_
(
"Rejected"
))
)
class
Article
(
UnDVotedMixin
):
url
=
models
.
URLField
(
"URL"
)
lang
=
models
.
CharField
(
_
(
"Language"
),
max_length
=
50
,
null
=
True
)
...
...
@@ -19,24 +26,23 @@ class Article(UnDVotedMixin):
updated_at
=
models
.
DateTimeField
(
_
(
"Last update"
),
auto_now
=
True
)
published_at
=
models
.
DateTimeField
(
_
(
"Publication date"
),
blank
=
True
,
null
=
True
)
STATUS_CHOICES
=
(
(
"PENDING"
,
_
(
"Pending"
)),
(
"PUBLISHED"
,
_
(
"Published"
)),
(
"REJECTED"
,
_
(
"Rejected"
))
)
status
=
models
.
CharField
(
_
(
"Status"
),
choices
=
STATUS_CHOICES
,
default
=
"PENDING"
,
max_length
=
20
)
tags
=
TaggableManager
()
#: priority: True if article have priority
priority
=
models
.
BooleanField
(
default
=
False
)
# TODO: adds links to user
tags
=
TaggableManager
()
class
Meta
:
verbose_name
=
_
(
"Article"
)
verbose_name_plural
=
_
(
"Articles"
)
permissions
=
(
(
"can_change_status"
,
"Can change article status"
),
(
"can_change_priority"
,
"Can change article priority"
),
(
"can_vote"
,
"Can vote articles"
),
)
def
__str__
(
self
):
return
self
.
title
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment