aboutsummaryrefslogtreecommitdiff
path: root/budget/forms.py
diff options
context:
space:
mode:
authorAlexis Metaireau <alexis@notmyidea.org>2011-07-23 18:45:40 +0200
committerAlexis Metaireau <alexis@notmyidea.org>2011-07-23 18:45:40 +0200
commit5e63a5034b841b90b8a8b2b5bc39cbb088e9803d (patch)
tree82c43d068ec782abd31864e998f09782c9b67be3 /budget/forms.py
parent4fcaf7d7ec583b794c14597d50abc89ef96450c9 (diff)
downloadihatemoney-mirror-5e63a5034b841b90b8a8b2b5bc39cbb088e9803d.zip
ihatemoney-mirror-5e63a5034b841b90b8a8b2b5bc39cbb088e9803d.tar.gz
ihatemoney-mirror-5e63a5034b841b90b8a8b2b5bc39cbb088e9803d.tar.bz2
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
Diffstat (limited to 'budget/forms.py')
-rw-r--r--budget/forms.py24
1 files changed, 24 insertions, 0 deletions
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")
+