aboutsummaryrefslogtreecommitdiff
path: root/budget/forms.py
diff options
context:
space:
mode:
author0livd <0livd@users.noreply.github.com>2017-02-22 23:40:52 +0100
committer0livd <0livd@users.noreply.github.com>2017-03-09 23:24:18 +0100
commite35480d6b7adf76f5bc4d46153b621abd722c681 (patch)
treeb80cbf5ae0ddee631cb0c0aa31940f71d94d5855 /budget/forms.py
parent8c412b391f9402f3840728ad1e6b8043e4ed8b7b (diff)
downloadihatemoney-mirror-e35480d6b7adf76f5bc4d46153b621abd722c681.zip
ihatemoney-mirror-e35480d6b7adf76f5bc4d46153b621abd722c681.tar.gz
ihatemoney-mirror-e35480d6b7adf76f5bc4d46153b621abd722c681.tar.bz2
Add export feature
Bills and transactions can now be exported to json or csv ref #28
Diffstat (limited to 'budget/forms.py')
-rw-r--r--budget/forms.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/budget/forms.py b/budget/forms.py
index c2455da..a097abe 100644
--- a/budget/forms.py
+++ b/budget/forms.py
@@ -174,3 +174,16 @@ class CreateArchiveForm(Form):
name = TextField(_("Name for this archive (optional)"), validators=[])
start_date = DateField(_("Start date"), validators=[Required()])
end_date = DateField(_("End date"), validators=[Required()], default=datetime.now)
+
+
+class ExportForm(Form):
+ export_type = SelectField(_("What do you want to download ?"),
+ validators=[Required()],
+ coerce=str,
+ choices=[("bills", _("bills")), ("transactions", _("transactions"))]
+ )
+ export_format = SelectField(_("Export file format"),
+ validators=[Required()],
+ coerce=str,
+ choices=[("csv", "csv"), ("json", "json")]
+ )