diff options
Diffstat (limited to '')
-rw-r--r-- | app/views/consts.py | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/app/views/consts.py b/app/views/consts.py index 53616a4..c76cf17 100644 --- a/app/views/consts.py +++ b/app/views/consts.py @@ -25,28 +25,28 @@ def one_year(d): # Form # class ConstForm(F.Form): - start = F.DateField(u'Beginn', F.req, + start = F.DateField('Beginn', F.req, format='%m.%Y', default=lambda: today()) - end = F.DateField(u'Ende', F.req, + end = F.DateField('Ende', F.req, format='%m.%Y', default=lambda: one_year(today()), - description=u'(einschließlich)') + description='(einschließlich)') - months = F.IntegerField(u'Zahlungsrythmus', F.req, + months = F.IntegerField('Zahlungsrythmus', F.req, description='Monate') - expense = F.DecimalField(u'Betrag', F.req, - description=u'EUR', + expense = F.DecimalField('Betrag', F.req, + description='EUR', places=2) - description = F.StringField(u'Beschreibung', F.req) + description = F.StringField('Beschreibung', F.req) - category = F.QuerySelectField(u'Kategorie', + category = F.QuerySelectField('Kategorie', get_label='name') - prev = F.QuerySelectField(u'Vorgänger', + prev = F.QuerySelectField('Vorgänger', get_label='description', allow_blank=True) @@ -126,7 +126,7 @@ def edit(id): elif form.flash_validate(): # change form.populate_obj(exp) db.session.commit() - flash(u"Eintrag geändert.") + flash("Eintrag geändert.") return redirect('.show', id = id) return { 'form': form } @@ -146,7 +146,7 @@ def add(): exp.user = current_user db.session.add(exp) db.session.commit() - flash(u"Eintrag hinzugefügt.") + flash("Eintrag hinzugefügt.") return redirect('.show', id = exp.id) return { 'form': form } |