2023-03-31 07:14:21 +00:00
|
|
|
from flask_wtf import FlaskForm
|
2022-10-02 21:49:14 +00:00
|
|
|
from wtforms import (
|
|
|
|
StringField,
|
|
|
|
SubmitField,
|
|
|
|
SelectMultipleField,
|
2023-03-14 10:13:35 +00:00
|
|
|
IntegerField
|
2022-10-02 21:49:14 +00:00
|
|
|
)
|
2022-10-26 08:12:54 +00:00
|
|
|
from wtforms.validators import InputRequired, Length
|
2022-10-02 21:49:14 +00:00
|
|
|
|
2022-11-15 14:11:16 +00:00
|
|
|
|
2023-03-31 07:14:21 +00:00
|
|
|
class ContributionBaseForm(FlaskForm):
|
2022-10-02 21:49:14 +00:00
|
|
|
title = StringField(
|
|
|
|
'Title',
|
|
|
|
validators=[InputRequired(), Length(max=64)]
|
|
|
|
)
|
|
|
|
description = StringField(
|
|
|
|
'Description',
|
|
|
|
validators=[InputRequired(), Length(max=255)]
|
|
|
|
)
|
|
|
|
version = StringField(
|
|
|
|
'Version',
|
|
|
|
validators=[InputRequired(), Length(max=16)]
|
|
|
|
)
|
|
|
|
publisher = StringField(
|
|
|
|
'Publisher',
|
|
|
|
validators=[InputRequired(), Length(max=128)]
|
|
|
|
)
|
|
|
|
publisher_url = StringField(
|
|
|
|
'Publisher URL',
|
|
|
|
validators=[InputRequired(), Length(max=512)]
|
|
|
|
)
|
|
|
|
publishing_url = StringField(
|
|
|
|
'Publishing URL',
|
|
|
|
validators=[InputRequired(), Length(max=512)]
|
|
|
|
)
|
|
|
|
publishing_year = IntegerField(
|
|
|
|
'Publishing year',
|
|
|
|
validators=[InputRequired()]
|
|
|
|
)
|
2022-11-17 11:48:19 +00:00
|
|
|
compatible_service_versions = SelectMultipleField(
|
|
|
|
'Compatible service versions'
|
|
|
|
)
|
2022-10-02 21:49:14 +00:00
|
|
|
submit = SubmitField()
|
|
|
|
|
2022-11-14 14:02:41 +00:00
|
|
|
|
2023-03-31 07:14:21 +00:00
|
|
|
class UpdateContributionBaseForm(ContributionBaseForm):
|
2022-11-17 09:46:16 +00:00
|
|
|
pass
|