]>
git.datanom.net - pwp.git/blob - app/forms.py
1 from flask_wtf
import FlaskForm
2 from wtforms
import StringField
, PasswordField
, SubmitField
, BooleanField
, IntegerField
3 from wtforms
.validators
import InputRequired
, Email
, Length
5 class LoginForm(FlaskForm
):
6 username
= StringField('Username', validators
=[InputRequired()])
7 password
= PasswordField('Password', validators
=[InputRequired()])
8 login
= SubmitField('Sign in')
10 class 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')
18 class 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')
24 class 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')
30 class SearchForm(FlaskForm
):
31 token
= StringField('Search')
32 search
= SubmitField('Submit')
34 class DeleteForm(FlaskForm
):
35 delete
= SubmitField('Submit')
37 class 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')
44 class PortfolioForm(FlaskForm
):
45 name
= StringField('Name', validators
=[InputRequired()])
46 visible
= BooleanField('Visible')
47 public
= BooleanField('Public')
48 portfolio
= SubmitField('Create')
This page took 0.18599 seconds and 6 git commands to generate.