-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmodels.py
30 lines (23 loc) · 896 Bytes
/
models.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
from django.db import models
class Import(models.Model):
url = models.URLField()
completed = models.BooleanField(default=False)
imported_articles = models.ManyToManyField('submission.Article')
class ImportedArticleAuthor(models.Model):
article = models.ForeignKey("submission.Article")
author = models.ForeignKey("core.Account")
class Meta:
unique_together = (("article", "author"),)
class ImportedArticleGalley(models.Model):
article = models.ForeignKey("submission.Article")
eprint_id = models.PositiveIntegerField()
version = models.PositiveIntegerField()
uri = models.URLField()
def __str__(self):
return "{}({}, eprint_id={}, version={}, uri={})".format(
self.__class__.__name__,
self.article,
self.eprint_id,
self.version,
self.uri,
)