]> git.datanom.net - pwp.git/blame_incremental - app/forms.py
initial commit
[pwp.git] / app / forms.py
... / ...
CommitLineData
1from flask_wtf import FlaskForm
2from wtforms import StringField, PasswordField, SubmitField, BooleanField, IntegerField
3from wtforms.validators import InputRequired, Email, Length
4
5class LoginForm(FlaskForm):
6 username = StringField('Username', validators=[InputRequired()])
7 password = PasswordField('Password', validators=[InputRequired()])
8 login = SubmitField('Sign in')
9
10class RegisterForm(FlaskForm):
11 name = StringField('Name', validators=[InputRequired()])
12 email = StringField('Email', validators=[InputRequired(), Email(message='Invalid email'), Length(max=80)])
13 username = StringField('Username', validators=[InputRequired(), Length(min=3, max=15)])
14 password = PasswordField('Password', validators=[InputRequired(), Length(min=8, max=80)])
15 passwordchk = PasswordField('Repeat password', validators=[InputRequired(), Length(min=8, max=80)])
16 register = SubmitField('Register')
17
18class UpdateForm(FlaskForm):
19 name = StringField('Name', validators=[InputRequired()])
20 email = StringField('Email', validators=[InputRequired(), Email(message='Invalid email'), Length(max=80)])
21 username = StringField('Username', validators=[InputRequired(), Length(min=3, max=15)])
22 update = SubmitField('Update')
23
24class PwForm(FlaskForm):
25 password = PasswordField('New password', validators=[InputRequired(), Length(min=8, max=80)])
26 passwordchk = PasswordField('Repeat password', validators=[InputRequired(), Length(min=8, max=80)])
27 passwordcur = PasswordField('Current password', validators=[InputRequired(), Length(min=8, max=80)])
28 pwchange = SubmitField('Change Password')
29
30class SearchForm(FlaskForm):
31 token = StringField('Search')
32 search = SubmitField('Submit')
33
34class DeleteForm(FlaskForm):
35 delete = SubmitField('Submit')
36
37class AlbumForm(FlaskForm):
38 name = StringField('Name', validators=[InputRequired()])
39 visible = BooleanField('Visible')
40 public = BooleanField('Public')
41 portfolio_id = IntegerField('Portfolio')
42 album = SubmitField('Create')
43
44class PortfolioForm(FlaskForm):
45 name = StringField('Name', validators=[InputRequired()])
46 visible = BooleanField('Visible')
47 public = BooleanField('Public')
48 portfolio = SubmitField('Create')
This page took 0.026656 seconds and 5 git commands to generate.