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
19ee249f
Commit
19ee249f
authored
7 years ago
by
Jorran de Wit
Browse files
Options
Downloads
Patches
Plain Diff
Remove redundant methods
parent
3ef0f968
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
journals/helpers.py
+3
-14
3 additions, 14 deletions
journals/helpers.py
journals/models.py
+1
-11
1 addition, 11 deletions
journals/models.py
with
4 additions
and
25 deletions
journals/helpers.py
+
3
−
14
View file @
19ee249f
...
@@ -2,27 +2,16 @@ from .exceptions import JournalNameError, PaperNumberError
...
@@ -2,27 +2,16 @@ from .exceptions import JournalNameError, PaperNumberError
def
journal_name_abbrev_citation
(
journal_name
):
def
journal_name_abbrev_citation
(
journal_name
):
if
journal_name
==
'
SciPost
Phys
ics
'
:
if
journal_name
==
'
SciPostPhys
'
:
return
'
SciPost Phys.
'
return
'
SciPost Phys.
'
elif
journal_name
==
'
SciPost
Phys
ics Select
'
:
elif
journal_name
==
'
SciPostPhys
Sel
'
:
return
'
SciPost Phys. Sel.
'
return
'
SciPost Phys. Sel.
'
elif
journal_name
==
'
SciPost
Phys
ics Lecture
Notes
'
:
elif
journal_name
==
'
SciPostPhys
Lect
Notes
'
:
return
'
SciPost Phys. Lect. Notes
'
return
'
SciPost Phys. Lect. Notes
'
else
:
else
:
raise
JournalNameError
(
journal_name
)
raise
JournalNameError
(
journal_name
)
def
journal_name_abbrev_doi
(
journal_name
):
if
journal_name
==
'
SciPost Physics
'
:
return
'
SciPostPhys
'
elif
journal_name
==
'
SciPost Physics Select
'
:
return
'
SciPostPhysSel
'
elif
journal_name
==
'
SciPost Physics Lecture Notes
'
:
return
'
SciPostPhysLectNotes
'
else
:
raise
JournalNameError
(
journal_name
)
def
paper_nr_string
(
nr
):
def
paper_nr_string
(
nr
):
if
nr
<
10
:
if
nr
<
10
:
return
'
00
'
+
str
(
nr
)
return
'
00
'
+
str
(
nr
)
...
...
This diff is collapsed.
Click to expand it.
journals/models.py
+
1
−
11
View file @
19ee249f
...
@@ -6,7 +6,7 @@ from django.urls import reverse
...
@@ -6,7 +6,7 @@ from django.urls import reverse
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_doi
,
journal_name_abbrev_citation
from
.helpers
import
paper_nr_string
,
journal_name_abbrev_citation
from
.managers
import
IssueManager
,
PublicationManager
from
.managers
import
IssueManager
,
PublicationManager
from
scipost.constants
import
SCIPOST_DISCIPLINES
,
SCIPOST_SUBJECT_AREAS
from
scipost.constants
import
SCIPOST_DISCIPLINES
,
SCIPOST_SUBJECT_AREAS
...
@@ -37,9 +37,6 @@ class Journal(models.Model):
...
@@ -37,9 +37,6 @@ class Journal(models.Model):
def
get_abbreviation_citation
(
self
):
def
get_abbreviation_citation
(
self
):
return
journal_name_abbrev_citation
(
self
.
name
)
return
journal_name_abbrev_citation
(
self
.
name
)
def
get_abbreviation_doi
(
self
):
return
journal_name_abbrev_doi
(
self
.
name
)
class
Volume
(
models
.
Model
):
class
Volume
(
models
.
Model
):
in_journal
=
models
.
ForeignKey
(
Journal
,
on_delete
=
models
.
CASCADE
)
in_journal
=
models
.
ForeignKey
(
Journal
,
on_delete
=
models
.
CASCADE
)
...
@@ -94,13 +91,6 @@ class Issue(models.Model):
...
@@ -94,13 +91,6 @@ class Issue(models.Model):
return
self
.
start_date
<=
timezone
.
now
().
date
()
and
\
return
self
.
start_date
<=
timezone
.
now
().
date
()
and
\
self
.
until_date
>=
timezone
.
now
().
date
()
self
.
until_date
>=
timezone
.
now
().
date
()
def
period
(
self
):
text
=
'
up to {{ until_month }} {{ year }}
'
template
=
Template
(
text
)
context
=
Context
({
'
until_month
'
:
self
.
start_date
.
strftime
(
'
%B
'
),
'
year
'
:
self
.
until_date
.
strftime
(
'
%Y
'
)})
return
template
.
render
(
context
)
class
Publication
(
models
.
Model
):
class
Publication
(
models
.
Model
):
accepted_submission
=
models
.
OneToOneField
(
'
submissions.Submission
'
,
on_delete
=
models
.
CASCADE
)
accepted_submission
=
models
.
OneToOneField
(
'
submissions.Submission
'
,
on_delete
=
models
.
CASCADE
)
...
...
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