Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F90427674
admin.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
Fri, Nov 1, 13:54
Size
2 KB
Mime Type
text/x-python
Expires
Sun, Nov 3, 13:54 (1 d, 22 h)
Engine
blob
Format
Raw Data
Handle
22073154
Attached To
rOACCT Open Access Compliance Check Tool (OACCT)
admin.py
View Options
from
django.contrib
import
admin
from
.models
import
Country
from
.models
import
City
from
.models
import
Language
from
.models
import
Issn
from
.models
import
Oa
from
.models
import
Publisher
from
.models
import
Journal
from
.models
import
Organization
from
.models
import
Version
from
.models
import
Licence
from
.models
import
Cost_factor_type
from
.models
import
Cost_factor
from
.models
import
Term
from
.models
import
ConditionType
from
.models
import
ConditionSet
from
.models
import
OrganizationCondition
from
.models
import
JournalCondition
from
import_export.admin
import
ImportExportModelAdmin
# Register your models here.
@admin.register
(
Journal
)
class
JournalAdmin
(
ImportExportModelAdmin
):
list_display
=
(
"id"
,
"name"
,
"journal_issns"
,)
def
journal_issns
(
self
,
obj
):
# TBD
pass
@admin.register
(
Language
)
class
LanguageAdmin
(
ImportExportModelAdmin
):
pass
@admin.register
(
Organization
)
class
InstitutionAdmin
(
ImportExportModelAdmin
):
list_display
=
(
"id"
,
"name"
)
@admin.register
(
Version
)
class
VersionAdmin
(
ImportExportModelAdmin
):
pass
@admin.register
(
City
)
class
CityAdmin
(
ImportExportModelAdmin
):
pass
@admin.register
(
Issn
)
class
IssnAdmin
(
ImportExportModelAdmin
):
pass
@admin.register
(
Oa
)
class
OaAdmin
(
ImportExportModelAdmin
):
pass
@admin.register
(
Publisher
)
class
PublisherAdmin
(
ImportExportModelAdmin
):
list_display
=
(
"id"
,
"name"
)
@admin.register
(
Term
)
class
TermAdmin
(
ImportExportModelAdmin
):
pass
@admin.register
(
ConditionType
)
class
ConditionTypeAdmin
(
ImportExportModelAdmin
):
list_display
=
(
"id"
,
"condition_issuer"
)
@admin.register
(
ConditionSet
)
class
CountryAdmin
(
ImportExportModelAdmin
):
list_display
=
(
"id"
,
"condition_type"
,
"comment"
)
@admin.register
(
OrganizationCondition
)
class
OrganizationSetAdmin
(
ImportExportModelAdmin
):
list_display
=
(
"id"
,
"organization_name"
,
"condition_set"
,
"valid_from"
,
"valid_until"
)
def
organization_name
(
self
,
obj
):
return
obj
.
organization
.
name
@admin.register
(
Licence
)
class
LicenceAdmin
(
ImportExportModelAdmin
):
pass
@admin.register
(
JournalCondition
)
class
JournalConditionAdmin
(
ImportExportModelAdmin
):
list_display
=
(
"id"
,
"journal_name"
,
"condition_set"
,
"valid_from"
,
"valid_until"
)
def
journal_name
(
self
,
obj
):
return
obj
.
journal
.
name
@admin.register
(
Cost_factor
)
class
Cost_factorAdmin
(
ImportExportModelAdmin
):
list_display
=
(
"id"
,
"comment"
,
"amount"
,
"symbol"
)
@admin.register
(
Cost_factor_type
)
class
Cost_factor_typeAdmin
(
ImportExportModelAdmin
):
list_display
=
(
"id"
,
"name"
)
Event Timeline
Log In to Comment