1 Star 0 Fork 7

yanhai00/Book-Management-System

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
forms.py 2.11 KB
一键复制 编辑 原始数据 按行查看 历史
lyric6667 提交于 2019-01-11 21:43 . 学生借书
from flask_wtf import FlaskForm
from wtforms import StringField, SubmitField, SelectField, PasswordField
from wtforms.validators import DataRequired, EqualTo, Length
class Login(FlaskForm):
account = StringField(u'账号', validators=[DataRequired()])
password = PasswordField(u'密码', validators=[DataRequired()])
submit = SubmitField(u'登录')
class ChangePasswordForm(FlaskForm):
old_password = PasswordField(u'原密码', validators=[DataRequired()])
password = PasswordField(u'新密码', validators=[DataRequired(), EqualTo('password2', message=u'两次密码必须一致!')])
password2 = PasswordField(u'确认新密码', validators=[DataRequired()])
submit = SubmitField(u'确认修改')
class EditInfoForm(FlaskForm):
name = StringField(u'用户名', validators=[Length(1, 32)])
submit = SubmitField(u'提交')
class SearchBookForm(FlaskForm):
methods = [('book_name', '书名'), ('author', '作者'), ('class_name', '类别'), ('isbn', 'ISBN')]
method = SelectField(choices=methods, validators=[DataRequired()], coerce=str)
content = StringField(validators=[DataRequired()])
submit = SubmitField('搜索')
class SearchStudentForm(FlaskForm):
card = StringField(validators=[DataRequired()])
submit = SubmitField('搜索')
class StoreForm(FlaskForm):
barcode = StringField(validators=[DataRequired(), Length(6)])
isbn = StringField(validators=[DataRequired(), Length(13)])
location = StringField(validators=[DataRequired(), Length(1, 32)])
submit = SubmitField(u'提交')
class NewStoreForm(FlaskForm):
isbn = StringField(validators=[DataRequired(), Length(13)])
book_name = StringField(validators=[DataRequired(), Length(1, 64)])
press = StringField(validators=[DataRequired(), Length(1, 32)])
author = StringField(validators=[DataRequired(), Length(1, 64)])
class_name = StringField(validators=[DataRequired(), Length(1, 64)])
submit = SubmitField(u'提交')
class BorrowForm(FlaskForm):
card = StringField(validators=[DataRequired()])
book_name = StringField(validators=[DataRequired()])
submit = SubmitField(u'搜索')
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Python
1
https://gitee.com/yanhai00/Book-Management-System.git
git@gitee.com:yanhai00/Book-Management-System.git
yanhai00
Book-Management-System
Book-Management-System
master

搜索帮助