diff options
Diffstat (limited to 'ishtar_common/forms_common.py')
| -rw-r--r-- | ishtar_common/forms_common.py | 22 | 
1 files changed, 21 insertions, 1 deletions
| diff --git a/ishtar_common/forms_common.py b/ishtar_common/forms_common.py index 72b33b4c4..bde5e47ed 100644 --- a/ishtar_common/forms_common.py +++ b/ishtar_common/forms_common.py @@ -37,7 +37,7 @@ import widgets  from bootstrap_datepicker.widgets import DatePicker  from ishtar_common.templatetags.link_to_window import link_to_window  from forms import FinalForm, FormSet, reverse_lazy, name_validator, \ -    TableSelect, ManageOldType, CustomForm, FieldType +    TableSelect, ManageOldType, CustomForm, FieldType, FormSetWithDeleteSwitches  def get_town_field(label=_(u"Town"), required=True): @@ -721,6 +721,26 @@ class AccountForm(forms.Form):          return cleaned_data +class ProfileForm(ManageOldType): +    form_label = _("Profiles") +    base_model = 'profile' +    associated_models = {'profile_type': models.ProfileType} +    profile_type = forms.ChoiceField(label=_(u"Type"), choices=[], +                                     required=False) +    pk = forms.IntegerField(label=" ", widget=forms.HiddenInput, required=False) + +    TYPES = [ +        FieldType('profile_type', models.ProfileType), +    ] + + +ProfileFormset = formset_factory(ProfileForm, can_delete=True, +                                 formset=FormSetWithDeleteSwitches) +ProfileFormset.form_label = _("Profiles") +ProfileFormset.form_admin_name = _(u"Profiles") +ProfileFormset.form_slug = "profiles" + +  class FinalAccountForm(forms.Form):      final = True      form_label = _("Confirm") | 
