summaryrefslogtreecommitdiff
path: root/controller.py
diff options
context:
space:
mode:
Diffstat (limited to 'controller.py')
-rw-r--r--controller.py40
1 files changed, 26 insertions, 14 deletions
diff --git a/controller.py b/controller.py
index 62eb235..ea8be5b 100644
--- a/controller.py
+++ b/controller.py
@@ -1,3 +1,4 @@
+# -*- encoding: utf-8 -*-
from __future__ import with_statement
import web
@@ -93,21 +94,25 @@ class Add:
form.Textbox(
"date",
form.notnull,
- Validator("Date Format does not match", lambda v: datetime.datetime.strptime(v, self.dformat)),
- value = datetime.date.today().strftime(self.dformat)
+ Validator("Datumsformat stimmt nicht", lambda v: datetime.datetime.strptime(v, self.dformat)),
+ value = datetime.date.today().strftime(self.dformat),
+ description = "Datum"
),
form.Textbox(
"expense",
form.notnull,
- Validator("Not a valid decimal", decimal.Decimal),
+ Validator("Keine Dezimalzahl", decimal.Decimal),
+ description = "Betrag"
),
form.Textbox(
"description",
- form.notnull
+ form.notnull,
+ description = "Beschreibung"
),
form.Dropdown(
"category",
- map(op.itemgetter(0), sorted(Category.query.values(Category.name)))
+ map(op.itemgetter(0), sorted(Category.query.values(Category.name))),
+ description = "Kategorie"
)
)
@@ -225,38 +230,45 @@ class ConstAdd:
form.Textbox(
"start",
form.notnull,
- Validator("Date Format does not match", lambda v: datetime.datetime.strptime(v, self.dformat)),
- value = datetime.date.today().strftime(self.dformat)
+ Validator("Datumsformat stimmt nicht", lambda v: datetime.datetime.strptime(v, self.dformat)),
+ value = datetime.date.today().strftime(self.dformat),
+ description = "Start"
),
form.Textbox(
"end",
form.notnull,
- Validator("Date Format does not match", lambda v: datetime.datetime.strptime(v, self.dformat)),
- value = datetime.date.today().strftime(self.dformat)
+ Validator("Datumsformat stimmt nicht", lambda v: datetime.datetime.strptime(v, self.dformat)),
+ value = datetime.date.today().strftime(self.dformat),
+ description = "Ende"
),
form.Textbox(
"months",
form.notnull,
- Validator("Not an integer > 0", lambda v: int(v) > 0),
+ Validator("Zahl muss größer als 0 sein", lambda v: int(v) > 0),
value = "12",
- description = "Number of Months"
+ description = "Zahlungsrhythmus",
+ post = " Monate"
),
form.Textbox(
"expense",
form.notnull,
Validator("Not a valid decimal", decimal.Decimal),
+ description = "Betrag"
),
form.Textbox(
"description",
- form.notnull
+ form.notnull,
+ description = "Beschreibung"
),
form.Dropdown(
"category",
- map(op.itemgetter(0), sorted(Category.query.values(Category.name)))
+ map(op.itemgetter(0), sorted(Category.query.values(Category.name))),
+ description = "Kategorie"
),
form.Dropdown(
"prev",
- iter.chain([(-1, '')], prev_list)
+ iter.chain([(-1, '')], prev_list),
+ description = "Vorgänger"
)
)