From 5e63a5034b841b90b8a8b2b5bc39cbb088e9803d Mon Sep 17 00:00:00 2001 From: Alexis Metaireau Date: Sat, 23 Jul 2011 18:45:40 +0200 Subject: Split the logic into different python modules: * web.py contains the controllers (also called views) + url definitions * models.py contains the models * forms.py contains the forms * utils.py contains a set of utility fonctions to ease the dev. process --- budget/forms.py | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 budget/forms.py (limited to 'budget/forms.py') diff --git a/budget/forms.py b/budget/forms.py new file mode 100644 index 0000000..60d1440 --- /dev/null +++ b/budget/forms.py @@ -0,0 +1,24 @@ +from flaskext.wtf import * + +# define forms +class CreationForm(Form): + name = TextField("Project name", validators=[Required()]) + id = TextField("Project identifier", validators=[Required()]) + password = PasswordField("Password", validators=[Required()]) + contact_email = TextField("Email", validators=[Required(), Email()]) + submit = SubmitField("Get in") + + +class AuthenticationForm(Form): + password = TextField("Password", validators=[Required()]) + submit = SubmitField("Get in") + + +class BillForm(Form): + what = TextField("What?", validators=[Required()]) + payer = SelectField("Payer", validators=[Required()]) + amount = DecimalField("Amount payed", validators=[Required()]) + payed_for = SelectMultipleField("Who has to pay for this?", + validators=[Required()]) + submit = SubmitField("Add the bill") + -- cgit v1.1