Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F102560092
webdeposit_model.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
Sat, Feb 22, 00:22
Size
2 KB
Mime Type
text/x-python
Expires
Mon, Feb 24, 00:22 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
24360144
Attached To
R3600 invenio-infoscience
webdeposit_model.py
View Options
# -*- coding: utf-8 -*-
##
## This file is part of Invenio.
## Copyright (C) 2012, 2013 CERN.
##
## Invenio is free software; you can redistribute it and/or
## modify it under the terms of the GNU General Public License as
## published by the Free Software Foundation; either version 2 of the
## License, or (at your option) any later version.
##
## Invenio is distributed in the hope that it will be useful, but
## WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
## General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with Invenio; if not, write to the Free Software Foundation, Inc.,
## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
"""
WebDeposit database models.
"""
# General imports.
from
invenio.sqlalchemyutils
import
db
# Create your models here.
class
WebDepositWorkflow
(
db
.
Model
):
"""Represents a deposition workflow."""
__tablename__
=
'depWORKFLOW'
uuid
=
db
.
Column
(
db
.
String
(
36
),
primary_key
=
True
)
deposition_type
=
db
.
Column
(
db
.
String
(
45
),
nullable
=
False
)
obj_json
=
db
.
Column
(
db
.
JSON
,
nullable
=
False
)
current_step
=
db
.
Column
(
db
.
Integer
(
15
,
unsigned
=
True
),
nullable
=
False
)
status
=
db
.
Column
(
db
.
Integer
(
10
,
unsigned
=
True
),
nullable
=
False
)
class
WebDepositDraft
(
db
.
Model
):
"""Represents a deposition draft."""
__tablename__
=
'depDRAFT'
uuid
=
db
.
Column
(
db
.
String
(
36
),
db
.
ForeignKey
(
WebDepositWorkflow
.
uuid
),
primary_key
=
True
)
deposition_type
=
db
.
Column
(
db
.
String
(
45
),
nullable
=
False
)
step
=
db
.
Column
(
db
.
Integer
(
15
,
unsigned
=
True
),
primary_key
=
True
,
autoincrement
=
False
)
user_id
=
db
.
Column
(
db
.
Integer
(
15
,
unsigned
=
True
),
nullable
=
False
)
form_type
=
db
.
Column
(
db
.
String
(
45
),
nullable
=
False
)
form_values
=
db
.
Column
(
db
.
JSON
,
nullable
=
False
)
timestamp
=
db
.
Column
(
db
.
DateTime
,
nullable
=
False
)
workflow
=
db
.
relationship
(
WebDepositWorkflow
,
backref
=
'drafts'
)
__all__
=
[
'WebDepositDraft'
,
'WebDepositWorkflow'
]
Event Timeline
Log In to Comment