aboutsummaryrefslogtreecommitdiff
path: root/budget/forms.py
diff options
context:
space:
mode:
authorAlexis Metaireau <alexis@notmyidea.org>2017-03-11 01:27:41 +0100
committerGitHub <noreply@github.com>2017-03-11 01:27:41 +0100
commit42854bd064404931eaccc3580ce505611162108b (patch)
treeb80cbf5ae0ddee631cb0c0aa31940f71d94d5855 /budget/forms.py
parent8c412b391f9402f3840728ad1e6b8043e4ed8b7b (diff)
parente35480d6b7adf76f5bc4d46153b621abd722c681 (diff)
downloadihatemoney-mirror-42854bd064404931eaccc3580ce505611162108b.zip
ihatemoney-mirror-42854bd064404931eaccc3580ce505611162108b.tar.gz
ihatemoney-mirror-42854bd064404931eaccc3580ce505611162108b.tar.bz2
Merge pull request #176 from 0livd/master
Add export feature
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")]
+ )