Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions zebra/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
from django.core.exceptions import NON_FIELD_ERRORS
from django.utils.dates import MONTHS

from six import iteritems

from zebra.conf import options
from zebra.widgets import NoNameSelect, NoNameTextInput

Expand All @@ -23,14 +25,14 @@ def __init__(self, *args, **kwargs):
self.fields['card_cvv'].label = "Card CVC"
self.fields['card_cvv'].help_text = "Card Verification Code; see rear of card."
months = [ (m[0], u'%02d - %s' % (m[0], unicode(m[1])))
for m in sorted(MONTHS.iteritems()) ]
for m in sorted(iteritems(MONTHS)) ]
self.fields['card_expiry_month'].choices = months

card_number = forms.CharField(required=False, max_length=20,
widget=NoNameTextInput())
card_cvv = forms.CharField(required=False, max_length=4,
widget=NoNameTextInput())
card_expiry_month = forms.ChoiceField(required=False, widget=NoNameSelect(),
choices=MONTHS.iteritems())
choices=iteritems(MONTHS))
card_expiry_year = forms.ChoiceField(required=False, widget=NoNameSelect(),
choices=options.ZEBRA_CARD_YEARS_CHOICES)