summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorRené 'Necoro' Neumann <necoro@necoro.net>2013-04-18 18:53:42 +0200
committerRené 'Necoro' Neumann <necoro@necoro.net>2013-04-18 18:53:42 +0200
commit92fcf8fcf23ac99aafd64a44e6cf8d4951dee796 (patch)
treec67cbcedc08259cec0b4cb3383772c2eafca1b6f /app
parentb9b9200795b9fe7f6d054f117934e179a44f0224 (diff)
downloadkosten-92fcf8fcf23ac99aafd64a44e6cf8d4951dee796.tar.gz
kosten-92fcf8fcf23ac99aafd64a44e6cf8d4951dee796.tar.bz2
kosten-92fcf8fcf23ac99aafd64a44e6cf8d4951dee796.zip
FIX: Make defaults in fields of forms a function.
Reason: Else default will be set on class creation -- which is bad if you use 'today()' ...
Diffstat (limited to '')
-rw-r--r--app/forms.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/app/forms.py b/app/forms.py
index 1ab3c72..8fbd4fb 100644
--- a/app/forms.py
+++ b/app/forms.py
@@ -28,7 +28,7 @@ req = [v.input_required()]
class ExpenseForm(Form):
date = DateField(u"Datum", req,
format="%d.%m.%Y",
- default=today())
+ default=lambda: today())
expense = DecimalField(u"Betrag", req,
description=u"EUR",
@@ -42,11 +42,11 @@ class ExpenseForm(Form):
class ConstForm(Form):
start = DateField(u"Beginn", req,
format="%m.%Y",
- default=today())
+ default=lambda: today())
end = DateField(u"Ende", req,
format="%m.%Y",
- default=today().replace(year = today().year + 1),
+ default=lambda: today().replace(year = today().year + 1),
description=u"(einschließlich)")
months = IntegerField(u"Zahlungsrythmus", req,
w=1'>Split and renamed gui_helperRené 'Necoro' Neumann4-249/+266 2008-03-18Splitted windows.pyRené 'Necoro' Neumann10-424/+549 2008-03-12Moved get_dependencies to top package classRené 'Necoro' Neumann4-50/+85 2008-03-11improved performance by caching the use_expand queriesRené 'Necoro' Neumann1-5/+14 2008-03-11use catapult varsRené 'Necoro' Neumann2-4/+6 2008-03-11Updated catapult stuffRené 'Necoro' Neumann5-56/+108 2008-03-10Generate correct KeyNotFoundExceptionRené 'Necoro' Neumann1-2/+2 2008-03-09Small changesRené 'Necoro' Neumann3-1/+4 2008-03-07Better session handlingRené 'Necoro' Neumann1-5/+54 2008-03-07Small changesRené 'Necoro' Neumann1-1/+4 2008-03-07Updated shm module to 1.2René 'Necoro' Neumann1-8/+21 2008-03-07Update TODORené 'Necoro' Neumann1-3/+1 2008-03-07hmm ... yesRené 'Necoro' Neumann1-1/+1 2008-03-06Used better exceptions for configuration parserRené 'Necoro' Neumann1-26/+114 2008-03-06Update translationRené 'Necoro' Neumann2-349/+393 2008-03-06Update createpot.shRené 'Necoro' Neumann1-3/+2 2008-03-06Use 'nofork' instead of 'nolistener'René 'Necoro' Neumann1-3/+3 2008-03-05Install glade files into template dir and not data dirRené 'Necoro' Neumann2-2/+1 2008-03-05Added dependency listRené 'Necoro' Neumann3-117/+237