Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F90945646
oacct-purge.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
Wed, Nov 6, 07:14
Size
1 KB
Mime Type
text/x-python
Expires
Fri, Nov 8, 07:14 (2 d)
Engine
blob
Format
Raw Data
Handle
22165284
Attached To
rOACCT Open Access Compliance Check Tool (OACCT)
oacct-purge.py
View Options
from
django.core.management
import
BaseCommand
from
django_api.models
import
Issn
from
django_api.models
import
Oa
from
django_api.models
import
Publisher
from
django_api.models
import
Journal
from
django_api.models
import
Organization
from
django_api.models
import
Version
from
django_api.models
import
Licence
from
django_api.models
import
Cost_factor_type
from
django_api.models
import
Cost_factor
from
django_api.models
import
Term
from
django_api.models
import
ConditionType
from
django_api.models
import
ConditionSet
from
django_api.models
import
OrganizationCondition
from
django_api.models
import
JournalCondition
class
Command
(
BaseCommand
):
help
=
(
'Automatically generates a filter class for a model '
'with all relations to the specified depth.'
)
def
handle
(
self
,
*
args
,
**
options
):
Issn
.
objects
.
all
()
.
delete
()
print
(
'Issns purged'
)
Publisher
.
objects
.
all
()
.
delete
()
print
(
'Publishers purged'
)
OrganizationCondition
.
objects
.
all
()
.
delete
()
print
(
'OrganizationConditions purged'
)
JournalCondition
.
objects
.
all
()
.
delete
()
print
(
'OrganizationConditions purged'
)
Journal
.
objects
.
all
()
.
delete
()
print
(
'Journals purged'
)
Organization
.
objects
.
all
()
.
delete
()
print
(
'Organizations purged'
)
Licence
.
objects
.
all
()
.
delete
()
print
(
'Licences purged'
)
Cost_factor
.
objects
.
all
()
.
delete
()
print
(
'Cost_factors purged'
)
Term
.
objects
.
all
()
.
delete
()
print
(
'Terms purged'
)
ConditionSet
.
objects
.
all
()
.
delete
()
print
(
'ConditionSets purged'
)
print
(
'Purge complete'
)
Event Timeline
Log In to Comment