Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F67942681
models.py
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Tue, Jun 25, 04:20
Size
1 KB
Mime Type
text/x-python
Expires
Thu, Jun 27, 04:20 (2 d)
Engine
blob
Format
Raw Data
Handle
18496721
Attached To
rOACCT Open Access Compliance Check Tool (OACCT)
models.py
View Options
from
django.db
import
models
from
django.contrib.auth.models
import
User
from
datetime
import
date
from
django.utils.translation
import
gettext
as
_
# test model with essential tables
class
Country
(
models
.
Model
):
name
=
models
.
CharField
(
max_length
=
120
,
null
=
False
,
default
=
'unknown'
)
def
__str__
(
self
):
return
f
"{self.name}"
class
Language
(
models
.
Model
):
name
=
models
.
CharField
(
max_length
=
120
,
null
=
False
)
def
__str__
(
self
):
return
f
"{self.name}"
class
Issn
(
models
.
Model
):
serial
=
models
.
CharField
(
max_length
=
9
,
null
=
False
)
def
__str__
(
self
):
return
f
"{self.serial}"
class
Journal
(
models
.
Model
):
name
=
models
.
CharField
(
max_length
=
60
,
null
=
False
)
# search journal with name
issn
=
models
.
ManyToManyField
(
"Issn"
)
# search journal with ISSN
website
=
models
.
URLField
(
max_length
=
120
)
languages
=
models
.
ManyToManyField
(
Language
)
country
=
models
.
ForeignKey
(
"Country"
,
on_delete
=
models
.
CASCADE
)
oa_status
=
models
.
PositiveSmallIntegerField
(
null
=
False
)
#??????
starting_year
=
models
.
DateField
(
_
(
"Date"
),
default
=
date
.
today
)
# add today for testing purpose
doaj_status
=
models
.
CharField
(
max_length
=
60
)
qoam_status
=
models
.
CharField
(
max_length
=
60
)
lockss_portico
=
models
.
CharField
(
max_length
=
120
)
def
__str__
(
self
):
return
f
"{self.title} from {self.website}"
class
Conditions
(
models
.
Model
):
journals
=
models
.
ManyToManyField
(
Journal
)
Event Timeline
Log In to Comment