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
994a4ff4
Commit
994a4ff4
authored
7 years ago
by
Jorran de Wit
Browse files
Options
Downloads
Patches
Plain Diff
Improve journals models `doi_string` db structure
parent
7b6eb2c6
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
journals/models.py
+10
-4
10 additions, 4 deletions
journals/models.py
with
10 additions
and
4 deletions
journals/models.py
+
10
−
4
View file @
994a4ff4
...
@@ -4,6 +4,8 @@ from django.template import Template, Context
...
@@ -4,6 +4,8 @@ from django.template import Template, Context
from
django.utils
import
timezone
from
django.utils
import
timezone
from
django.urls
import
reverse
from
django.urls
import
reverse
from
.behaviors
import
doi_journal_validator
,
doi_volume_validator
,
\
doi_issue_validator
,
doi_publication_validator
from
.constants
import
SCIPOST_JOURNALS
,
SCIPOST_JOURNALS_DOMAINS
,
\
from
.constants
import
SCIPOST_JOURNALS
,
SCIPOST_JOURNALS_DOMAINS
,
\
STATUS_DRAFT
,
STATUS_PUBLISHED
,
ISSUE_STATUSES
STATUS_DRAFT
,
STATUS_PUBLISHED
,
ISSUE_STATUSES
from
.helpers
import
paper_nr_string
,
journal_name_abbrev_citation
from
.helpers
import
paper_nr_string
,
journal_name_abbrev_citation
...
@@ -24,7 +26,8 @@ class UnregisteredAuthor(models.Model):
...
@@ -24,7 +26,8 @@ class UnregisteredAuthor(models.Model):
class
Journal
(
models
.
Model
):
class
Journal
(
models
.
Model
):
name
=
models
.
CharField
(
max_length
=
100
,
choices
=
SCIPOST_JOURNALS
,
unique
=
True
)
name
=
models
.
CharField
(
max_length
=
100
,
choices
=
SCIPOST_JOURNALS
,
unique
=
True
)
doi_string
=
models
.
CharField
(
max_length
=
200
,
blank
=
True
,
unique
=
True
)
doi_string
=
models
.
CharField
(
max_length
=
200
,
unique
=
True
,
db_index
=
True
,
validators
=
[
doi_journal_validator
])
issn
=
models
.
CharField
(
max_length
=
16
,
default
=
'
2542-4653
'
)
issn
=
models
.
CharField
(
max_length
=
16
,
default
=
'
2542-4653
'
)
active
=
models
.
BooleanField
(
default
=
True
)
active
=
models
.
BooleanField
(
default
=
True
)
...
@@ -43,7 +46,8 @@ class Volume(models.Model):
...
@@ -43,7 +46,8 @@ class Volume(models.Model):
number
=
models
.
PositiveSmallIntegerField
()
number
=
models
.
PositiveSmallIntegerField
()
start_date
=
models
.
DateField
(
default
=
timezone
.
now
)
start_date
=
models
.
DateField
(
default
=
timezone
.
now
)
until_date
=
models
.
DateField
(
default
=
timezone
.
now
)
until_date
=
models
.
DateField
(
default
=
timezone
.
now
)
doi_string
=
models
.
CharField
(
max_length
=
200
,
blank
=
True
,
unique
=
True
)
doi_string
=
models
.
CharField
(
max_length
=
200
,
unique
=
True
,
db_index
=
True
,
validators
=
[
doi_volume_validator
])
class
Meta
:
class
Meta
:
unique_together
=
(
'
number
'
,
'
in_journal
'
)
unique_together
=
(
'
number
'
,
'
in_journal
'
)
...
@@ -58,7 +62,8 @@ class Issue(models.Model):
...
@@ -58,7 +62,8 @@ class Issue(models.Model):
start_date
=
models
.
DateField
(
default
=
timezone
.
now
)
start_date
=
models
.
DateField
(
default
=
timezone
.
now
)
until_date
=
models
.
DateField
(
default
=
timezone
.
now
)
until_date
=
models
.
DateField
(
default
=
timezone
.
now
)
status
=
models
.
CharField
(
max_length
=
20
,
choices
=
ISSUE_STATUSES
,
default
=
STATUS_PUBLISHED
)
status
=
models
.
CharField
(
max_length
=
20
,
choices
=
ISSUE_STATUSES
,
default
=
STATUS_PUBLISHED
)
doi_string
=
models
.
CharField
(
max_length
=
200
,
blank
=
True
,
unique
=
True
)
doi_string
=
models
.
CharField
(
max_length
=
200
,
unique
=
True
,
db_index
=
True
,
validators
=
[
doi_issue_validator
])
# absolute path on filesystem: (JOURNALS_DIR)/journal/vol/issue/
# absolute path on filesystem: (JOURNALS_DIR)/journal/vol/issue/
path
=
models
.
CharField
(
max_length
=
200
)
path
=
models
.
CharField
(
max_length
=
200
)
...
@@ -122,7 +127,8 @@ class Publication(models.Model):
...
@@ -122,7 +127,8 @@ class Publication(models.Model):
metadata
=
JSONField
(
default
=
{},
blank
=
True
,
null
=
True
)
metadata
=
JSONField
(
default
=
{},
blank
=
True
,
null
=
True
)
metadata_xml
=
models
.
TextField
(
blank
=
True
,
null
=
True
)
# for Crossref deposit
metadata_xml
=
models
.
TextField
(
blank
=
True
,
null
=
True
)
# for Crossref deposit
BiBTeX_entry
=
models
.
TextField
(
blank
=
True
,
null
=
True
)
BiBTeX_entry
=
models
.
TextField
(
blank
=
True
,
null
=
True
)
doi_string
=
models
.
CharField
(
max_length
=
200
,
blank
=
True
,
unique
=
True
)
# Used for file name
doi_string
=
models
.
CharField
(
max_length
=
200
,
unique
=
True
,
db_index
=
True
,
validators
=
[
doi_publication_validator
])
submission_date
=
models
.
DateField
(
verbose_name
=
'
submission date
'
)
submission_date
=
models
.
DateField
(
verbose_name
=
'
submission date
'
)
acceptance_date
=
models
.
DateField
(
verbose_name
=
'
acceptance date
'
)
acceptance_date
=
models
.
DateField
(
verbose_name
=
'
acceptance date
'
)
publication_date
=
models
.
DateField
(
verbose_name
=
'
publication date
'
)
publication_date
=
models
.
DateField
(
verbose_name
=
'
publication date
'
)
...
...
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