64 lines
1.6 KiB
Python
64 lines
1.6 KiB
Python
|
"""Form object declaration."""
|
||
|
from flask_wtf import FlaskForm
|
||
|
from wtforms import StringField, IntegerField, TextField, RadioField, SubmitField
|
||
|
from wtforms.validators import DataRequired, Length
|
||
|
|
||
|
|
||
|
class PublicationForm(FlaskForm):
|
||
|
"""Contact form."""
|
||
|
uploadpublication = StringField(
|
||
|
'Title of the publication:',
|
||
|
[DataRequired()]
|
||
|
)
|
||
|
author = StringField(
|
||
|
'The author or editor:',
|
||
|
[DataRequired()]
|
||
|
)
|
||
|
year = IntegerField(
|
||
|
'Year:',
|
||
|
[DataRequired()]
|
||
|
)
|
||
|
custodian = StringField(
|
||
|
'Custodian:',
|
||
|
[DataRequired()]
|
||
|
)
|
||
|
fields = StringField(
|
||
|
'Fields:',
|
||
|
[DataRequired()]
|
||
|
)
|
||
|
type = StringField(
|
||
|
'Type:',
|
||
|
[DataRequired()]
|
||
|
)
|
||
|
publishers = StringField(
|
||
|
'Publishers:',
|
||
|
[DataRequired()]
|
||
|
)
|
||
|
license = StringField(
|
||
|
'License:',
|
||
|
[DataRequired()]
|
||
|
)
|
||
|
licenseshort = RadioField(
|
||
|
'Select the closest license type:',
|
||
|
choices = [
|
||
|
('Anti-copyright','Anti-copyright'),
|
||
|
('No License Mentioned','No License Mentioned'),
|
||
|
('Free Art License','Free Art License'),
|
||
|
('Copyright','Copyright'),
|
||
|
('Copyleft','Copyleft'),
|
||
|
('Creative Commons','Creative Commons'),
|
||
|
('Public Domain','Public Domain'),
|
||
|
('GNU Free Documentation License','GNU Free Documentation License'),
|
||
|
]
|
||
|
)
|
||
|
highlights = TextField(
|
||
|
'Highlights from the publication:'
|
||
|
)
|
||
|
comments = TextField(
|
||
|
'Comments on the publication:'
|
||
|
)
|
||
|
borrowed = StringField(
|
||
|
'Currently borrowed by:'
|
||
|
)
|
||
|
submit = SubmitField('Submit')
|