-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathforms.py
More file actions
executable file
·50 lines (42 loc) · 1.59 KB
/
forms.py
File metadata and controls
executable file
·50 lines (42 loc) · 1.59 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
from flask_wtf import FlaskForm
from wtforms import TextField,\
TextAreaField, SubmitField, HiddenField, PasswordField
from wtforms import validators, ValidationError
WTF_CSRF_SECRET_KEY = 'a random string'
class UserForm(FlaskForm):
name = TextField(
"User Name",
[validators.Required("Please enter your name")])
password = PasswordField(
"Password",
[validators.Required("Please enter your password")])
email = TextField(
"Email",
[validators.Required("Please enter your email address."),
validators.Email("Please check your email format.")])
extra = TextAreaField("Extra Info")
submit = SubmitField("Send")
class EventForm(FlaskForm):
title = TextField(
"Eent Title",
[validators.Required("Please enter your Event Title")])
body = TextAreaField(
"Event Detail",
[validators.Required("Please enter your Event Content")])
pub_date = TextField(
"Publish Date")
is_update = HiddenField('Is update', default=None)
event_id = HiddenField(default=False)
update_date = HiddenField(default=False)
submit = SubmitField("Send")
class UpdatePassForm(FlaskForm):
old_pass = PasswordField(
"Current Password",
[validators.Required("Please enter your current password")])
new_pass = PasswordField(
"New Password",
[validators.Required("Please enter your new password")])
new_pass_verify = PasswordField(
"Verify New Password",
[validators.Required("Please enter your new password Again")])
submit = SubmitField("Update")