aboutsummaryrefslogtreecommitdiff
path: root/payments/utils.py
diff options
context:
space:
mode:
authorMarcin Gębala <maarcin.gebala@gmail.com>2017-02-23 13:36:17 +0100
committerMarcin Gębala <maarcin.gebala@gmail.com>2017-02-23 13:36:17 +0100
commita79e22f405eb9d6585a131c132e73ec08fad314e (patch)
tree8bb6dde31ee70028c5460e0b478b06f4d9c24f34 /payments/utils.py
parentdd3d7aa477b1c8be2b589063f4b696d1c0d167fe (diff)
downloaddjango-payments-taler-a79e22f405eb9d6585a131c132e73ec08fad314e.tar.gz
django-payments-taler-a79e22f405eb9d6585a131c132e73ec08fad314e.tar.bz2
django-payments-taler-a79e22f405eb9d6585a131c132e73ec08fad314e.zip
Move functions that generate choices to utils
Diffstat (limited to 'payments/utils.py')
-rw-r--r--payments/utils.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/payments/utils.py b/payments/utils.py
new file mode 100644
index 0000000..2d78659
--- /dev/null
+++ b/payments/utils.py
@@ -0,0 +1,14 @@
+from datetime import date
+
+from django.utils.translation import ugettext_lazy as _
+
+
+def get_month_choices():
+ month_choices = [(str(x), '%02d' % (x,)) for x in range(1, 13)]
+ return [('', _('Month'))] + month_choices
+
+
+def get_year_choices():
+ year_choices = [(str(x), str(x)) for x in range(
+ date.today().year, date.today().year + 15)]
+ return [('', _('Year'))] + year_choices