summaryrefslogtreecommitdiff
path: root/app/forms.py
diff options
context:
space:
mode:
Diffstat (limited to 'app/forms.py')
-rw-r--r--app/forms.py28
1 files changed, 28 insertions, 0 deletions
diff --git a/app/forms.py b/app/forms.py
new file mode 100644
index 0000000..ae6a2dc
--- /dev/null
+++ b/app/forms.py
@@ -0,0 +1,28 @@
+from flask_wtf import FlaskForm
+from wtforms import StringField, PasswordField, SubmitField, BooleanField
+from wtforms.validators import DataRequired, Length, EqualTo
+
+
+class RegistrationForm(FlaskForm):
+ alias = StringField('Alias',
+ validators=[DataRequired(),
+ Length(min=2, max=20)])
+ password = PasswordField('Password', validators=[DataRequired()])
+ password_confirm = PasswordField(
+ 'Confirm Password', validators=[DataRequired(),
+ EqualTo('password')])
+ submit = SubmitField('Create Alias')
+
+
+class LoginForm(FlaskForm):
+ alias = StringField('Alias',
+ validators=[DataRequired(),
+ Length(min=2, max=20)])
+ password = PasswordField('Password', validators=[DataRequired()])
+ remember = BooleanField('Remember Alias')
+ submit = SubmitField('Login Alias')
+
+
+class NewMessage(FlaskForm):
+ recipient = StringField('Recipient', validators=[DataRequired()])
+ message = StringField('message', validators=[DataRequired()])
Copyright 2019--2024 Marius PETER