SciPost Code Repository

Skip to content
Snippets Groups Projects
Commit a7e8ef82 authored by Jorran de Wit's avatar Jorran de Wit
Browse files

Remove ArxivCallable mixin

parent bf1a8734
No related branches found
No related tags found
No related merge requests found
......@@ -4,7 +4,7 @@ from django.core.urlresolvers import reverse
from django.template import Template, Context
from journals.constants import SCIPOST_JOURNALS_DOMAINS
from scipost.behaviors import ArxivCallable, TimeStampedModel
from scipost.behaviors import TimeStampedModel
from scipost.models import Contributor
from scipost.constants import SCIPOST_DISCIPLINES, DISCIPLINE_PHYSICS, SCIPOST_SUBJECT_AREAS
......@@ -12,7 +12,7 @@ from .constants import COMMENTARY_TYPES
from .managers import CommentaryManager
class Commentary(ArxivCallable, TimeStampedModel):
class Commentary(TimeStampedModel):
"""
A Commentary contains all the contents of a SciPost Commentary page for a given publication.
"""
......@@ -72,10 +72,6 @@ class Commentary(ArxivCallable, TimeStampedModel):
def __str__(self):
return self.pub_title
@classmethod
def same_version_exists(self, identifier):
return self.objects.filter(arxiv_identifier=identifier).exists()
def title_label(self):
context = Context({
'scipost_url': reverse('commentaries:commentary', args=(self.arxiv_or_DOI_string,)),
......
......@@ -4,16 +4,6 @@ from django.utils import timezone
from .db.fields import AutoDateTimeField
class ArxivCallable(object):
'''Models that contain a Arxiv identification should contain these
methods to be compatible with the ArxivCaller().
'''
@classmethod
def same_version_exists(self, identifier):
'''Check if the given identifier already is present in the database.'''
raise NotImplementedError
class TimeStampedModel(models.Model):
"""
All objects should inherit from this abstract model.
......
# Module for making external api calls as needed in the submissions cycle
import feedparser
import requests
import re
import datetime
import dateutil.parser
from django.template import Template, Context
from .behaviors import ArxivCallable
from strings import arxiv_caller_errormessages
class DOICaller:
def __init__(self, doi_string):
......
......@@ -16,7 +16,6 @@ from .managers import SubmissionManager, EditorialAssignmentManager, EICRecommen
from .utils import ShortSubmissionCycle, DirectRecommendationSubmissionCycle,\
GeneralSubmissionCycle
from scipost.behaviors import ArxivCallable
from scipost.constants import TITLE_CHOICES
from scipost.fields import ChoiceArrayField
from scipost.models import Contributor
......@@ -28,7 +27,7 @@ from journals.models import Publication
###############
# Submissions:
###############
class Submission(ArxivCallable, models.Model):
class Submission(models.Model):
# Main submission fields
author_comments = models.TextField(blank=True, null=True)
author_list = models.CharField(max_length=1000, verbose_name="author list")
......@@ -164,6 +163,19 @@ class Submission(ArxivCallable, models.Model):
return self.reports.awaiting_vetting().count()
class SubmissionEvent(models.Model):
partner = models.ForeignKey('partners.Partner', on_delete=models.CASCADE,
related_name='events')
event = models.CharField(max_length=64, choices=PARTNER_EVENTS)
comments = models.TextField(blank=True)
noted_on = models.DateTimeField(auto_now_add=True)
noted_by = models.ForeignKey(User, on_delete=models.CASCADE)
def __str__(self):
return '%s: %s' % (str(self.partner), self.get_event_display())
######################
# Editorial workflow #
######################
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment