from django import forms
from django.conf import settings
from django.utils.translation import ugettext_lazy as _
from purist.forms import ConfirmAddressForm


class ChooseBundleForm(ConfirmAddressForm):

    def __init__(self, choices=[(1, 'NoConf')], *args, **kwargs):
        super(ChooseBundleForm, self).__init__(*args, **kwargs)
        self.fields['bundle'] = forms.ChoiceField(
            label=_('You can change to the following bundles'),
            widget=forms.RadioSelect,
            choices=choices
        )
        self.fields['address'].label = _(
            'Type in your {} address to confirm the change'.format(
                settings.SITE_TITLE))
        self.order_fields(('bundle', 'address'))
