-
Notifications
You must be signed in to change notification settings - Fork 0
/
forms.py
29 lines (22 loc) · 1.18 KB
/
forms.py
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
from wtforms import Form,StringField,TextAreaField,PasswordField,validators,\
BooleanField, IntegerField, DateField
from wtforms.ext.sqlalchemy.fields import QuerySelectField
from flask import Flask
from flask_sqlalchemy import SQLAlchemy
app = Flask(__name__)
app.config.from_pyfile('config.cfg')
db = SQLAlchemy(app)
class LoginForm(Form):
login = StringField('Login', [validators.Length(min=2, max=50)])
password = PasswordField('Password', [validators.DataRequired()])
#remember = BooleanField('remember me')
class NewChild(Form):
parent_surname = StringField('Parent surname',[validators.Length(min=2, max=50)])
parent_name = StringField('Parent name',[validators.Length(min=2, max=50)])
parent_patronymic = StringField('Parent patronymic', [validators.Length(min=2, max=50)])
child_surname = StringField('Child surname', [validators.Length(min=2, max=50)])
child_name = StringField('Child name', [validators.Length(min=2, max=50)])
child_patronymic = StringField('Child patronymic', [validators.Length(min=2, max=50)])
# payment_sum = IntegerField('Payment sum')
class AddReport(Form):
number_of_visiting_days = IntegerField('Number of visiting days')