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
19903e75
Commit
19903e75
authored
Apr 22, 2017
by
cynddl
Browse files
Fix missing options for Article model
parent
5df206e6
Changes
4
Hide whitespace changes
Inline
Side-by-side
apps/rp/migrations/0005_auto_20170422_1917.py
0 → 100644
View file @
19903e75
# -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2017-04-22 19:17
from
__future__
import
unicode_literals
from
django.db
import
migrations
,
models
class
Migration
(
migrations
.
Migration
):
dependencies
=
[
(
'rp'
,
'0004_auto_20170422_1906'
),
]
operations
=
[
migrations
.
RemoveField
(
model_name
=
'article'
,
name
=
'published'
,
),
migrations
.
AddField
(
model_name
=
'article'
,
name
=
'status'
,
field
=
models
.
CharField
(
choices
=
[(
'PENDING'
,
'Pending'
),
(
'PUBLISHED'
,
'Published'
),
(
'REJECTED'
,
'Rejected'
)],
default
=
'PENDING'
,
max_length
=
20
,
verbose_name
=
'Published'
),
),
]
apps/rp/migrations/0006_auto_20170422_1920.py
0 → 100644
View file @
19903e75
# -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2017-04-22 19:20
from
__future__
import
unicode_literals
from
django.db
import
migrations
,
models
class
Migration
(
migrations
.
Migration
):
dependencies
=
[
(
'rp'
,
'0005_auto_20170422_1917'
),
]
operations
=
[
migrations
.
AlterField
(
model_name
=
'article'
,
name
=
'extracts'
,
field
=
models
.
TextField
(
blank
=
True
,
null
=
True
,
verbose_name
=
'Content extracts'
),
),
migrations
.
AlterField
(
model_name
=
'article'
,
name
=
'lang'
,
field
=
models
.
CharField
(
max_length
=
50
,
null
=
True
,
verbose_name
=
'Language'
),
),
migrations
.
AlterField
(
model_name
=
'article'
,
name
=
'metadata'
,
field
=
models
.
TextField
(
blank
=
True
,
null
=
True
,
verbose_name
=
'Opengraph metadata'
),
),
migrations
.
AlterField
(
model_name
=
'article'
,
name
=
'published_at'
,
field
=
models
.
DateTimeField
(
blank
=
True
,
null
=
True
,
verbose_name
=
'Publication date'
),
),
migrations
.
AlterField
(
model_name
=
'article'
,
name
=
'screenshot'
,
field
=
models
.
ImageField
(
blank
=
True
,
null
=
True
,
upload_to
=
''
,
verbose_name
=
'Article screenshot'
),
),
migrations
.
AlterField
(
model_name
=
'article'
,
name
=
'title'
,
field
=
models
.
CharField
(
default
=
''
,
max_length
=
255
,
verbose_name
=
'Article title'
),
),
]
apps/rp/migrations/0007_article_website.py
0 → 100644
View file @
19903e75
# -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2017-04-22 20:25
from
__future__
import
unicode_literals
from
django.db
import
migrations
,
models
class
Migration
(
migrations
.
Migration
):
dependencies
=
[
(
'rp'
,
'0006_auto_20170422_1920'
),
]
operations
=
[
migrations
.
AddField
(
model_name
=
'article'
,
name
=
'website'
,
field
=
models
.
CharField
(
default
=
''
,
max_length
=
255
,
verbose_name
=
'Website'
),
),
]
apps/rp/models/article.py
View file @
19903e75
...
...
@@ -7,16 +7,25 @@ from newspaper import Article as ArticleParser
class
Article
(
UnDVotedMixin
):
url
=
models
.
URLField
(
"URL"
)
lang
=
models
.
CharField
(
_
(
"Language"
),
max_length
=
50
)
metadata
=
models
.
TextField
(
_
(
"Opengraph metadata"
))
screenshot
=
models
.
ImageField
(
_
(
"Article screenshot"
))
title
=
models
.
CharField
(
_
(
"Article title"
),
max_length
=
255
)
extracts
=
models
.
TextField
(
_
(
"Content extracts"
))
lang
=
models
.
CharField
(
_
(
"Language"
),
max_length
=
50
,
null
=
True
)
metadata
=
models
.
TextField
(
_
(
"Opengraph metadata"
),
blank
=
True
,
null
=
True
)
screenshot
=
models
.
ImageField
(
_
(
"Article screenshot"
),
blank
=
True
,
null
=
True
)
title
=
models
.
CharField
(
_
(
"Article title"
),
max_length
=
255
,
default
=
""
)
website
=
models
.
CharField
(
_
(
"Website"
),
max_length
=
255
,
default
=
""
)
extracts
=
models
.
TextField
(
_
(
"Content extracts"
),
blank
=
True
,
null
=
True
)
published_at
=
models
.
DateTimeField
(
_
(
"Publication date"
))
created_at
=
models
.
DateTimeField
(
_
(
"Creation date"
),
auto_now_add
=
True
)
updated_at
=
models
.
DateTimeField
(
_
(
"Last update"
),
auto_now
=
True
)
published
=
models
.
BooleanField
(
_
(
"Published"
))
published_at
=
models
.
DateTimeField
(
_
(
"Publication date"
),
blank
=
True
,
null
=
True
)
STATUS_CHOICES
=
(
(
"PENDING"
,
_
(
"Pending"
)),
(
"PUBLISHED"
,
_
(
"Published"
)),
(
"REJECTED"
,
_
(
"Rejected"
))
)
status
=
models
.
CharField
(
_
(
"Published"
),
choices
=
STATUS_CHOICES
,
default
=
"PENDING"
,
max_length
=
20
)
tags
=
TaggableManager
()
...
...
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