diff options
Diffstat (limited to 'budget/forms.py')
| -rw-r--r-- | budget/forms.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/budget/forms.py b/budget/forms.py index 499f382..cf5068b 100644 --- a/budget/forms.py +++ b/budget/forms.py @@ -87,6 +87,16 @@ class AuthenticationForm(Form): submit = SubmitField("Get in") +class PasswordReminder(Form): + id = TextField("Project identifier", validators=[Required()]) + submit = SubmitField("Send me the code by email") + + def validate_id(form, field): + if not Project.query.get(field.data): + raise ValidationError("This project does not exists") + + + class BillForm(Form): date = DateField("Date", validators=[Required()], default=datetime.now) what = TextField("What?", validators=[Required()]) |
