Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F74196722
photo_form.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, Jul 26, 10:25
Size
808 B
Mime Type
text/x-python
Expires
Sun, Jul 28, 10:25 (1 d, 21 h)
Engine
blob
Format
Raw Data
Handle
19352981
Attached To
R3600 invenio-infoscience
photo_form.py
View Options
import
os
from
wtforms
import
Form
,
\
TextField
,
\
FileField
,
\
FormField
,
\
SubmitField
from
invenio.webinterface_handler_flask_utils
import
_
# Import custom fields
from
invenio.webdeposit_load_fields
import
fields
from
invenio.webdeposit_field_widgets
import
bootstrap_submit
__all__
=
[
'PhotoForm'
]
class
Dimensions
(
Form
):
height
=
TextField
(
'Height'
)
width
=
TextField
(
'Width'
)
class
PhotoForm
(
Form
):
title
=
fields
.
TitleField
(
label
=
_
(
'Photo Title'
))
dimensions
=
FormField
(
Dimensions
)
file
=
FileField
(
_
(
'File'
))
submit
=
SubmitField
(
_
(
'Submit Photo'
),
widget
=
bootstrap_submit
)
#configuration variables
_title
=
_
(
"Submit a Photo"
)
_drafting
=
True
#enable and disable drafting
Event Timeline
Log In to Comment