summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--app/views/consts.py6
-rw-r--r--app/views/expenses.py3
2 files changed, 6 insertions, 3 deletions
diff --git a/app/views/consts.py b/app/views/consts.py
index 0cc7199..66c8938 100644
--- a/app/views/consts.py
+++ b/app/views/consts.py
@@ -44,11 +44,13 @@ class ConstForm(F.Form):
description = F.StringField('Beschreibung', F.req)
category = F.QuerySelectField('Kategorie',
- get_label='name')
+ get_label='name',
+ get_pk=lambda c: c.id)
prev = F.QuerySelectField('Vorgänger',
get_label='description',
- allow_blank=True)
+ allow_blank=True,
+ get_pk=lambda p: p.id)
def __init__(self, cur=None, obj=None):
obj = cur if obj is None else obj
diff --git a/app/views/expenses.py b/app/views/expenses.py
index c504881..8061590 100644
--- a/app/views/expenses.py
+++ b/app/views/expenses.py
@@ -30,7 +30,8 @@ class ExpenseForm(F.Form):
description = F.StringField('Beschreibung')
category = F.QuerySelectField('Kategorie',
- get_label='name')
+ get_label='name',
+ get_pk=lambda c: c.id)
def __init__(self, obj = None, description_req = True):
super().__init__(obj = obj)