def __init__(self, request=None, *args, **kwargs): self.request = request rest_data = kwargs.pop('rest_data') super(CMAuthenticationForm, self).__init__(*args, **kwargs) self.fields['cm'] = forms.ChoiceField(choices=parsing.parse_cm_list(rest_data), initial=request.session['user'].default_cluster_id, widget=SelectWithDisabled(attrs=dict({'class': 'small'})), label=_("Cluster Manager")) self.fields.keyOrder = ['cm', 'password']
def __init__(self, *args, **kwargs): rest_data = kwargs.pop('rest_data') try: self.old_email = args[0]['email'] except Exception: self.old_email = kwargs['data']['email'] super(AccountDataEdit, self).__init__(*args, **kwargs) self.fields['default_cluster_id'] = forms.ChoiceField(choices=parsing.parse_cm_list(rest_data), label=_('Default CM')) self.fields['default_cluster_id'].widget.attrs['class'] = 'medium'
def __init__(self, request=None, *args, **kwargs): self.request = request rest_data = kwargs.pop("rest_data") super(CMAuthenticationForm, self).__init__(*args, **kwargs) self.fields["cm"] = forms.ChoiceField( choices=parsing.parse_cm_list(rest_data), initial=request.session["user"].default_cluster_id, widget=SelectWithDisabled(attrs=dict({"class": "small"})), label=_("Cluster Manager"), ) self.fields.keyOrder = ["cm", "password"]
def __init__(self, *args, **kwargs): rest_data = kwargs.pop("rest_data") try: self.old_email = args[0]["email"] except Exception: self.old_email = kwargs["data"]["email"] super(AccountDataEdit, self).__init__(*args, **kwargs) self.fields["default_cluster_id"] = forms.ChoiceField( choices=parsing.parse_cm_list(rest_data), label=_("Default CM") ) self.fields["default_cluster_id"].widget.attrs["class"] = "medium"
def __init__(self, *args, **kwargs): """ """ rest_data = kwargs.pop('rest_data') try: self.old_email = args[0]['email'] except Exception: self.old_email = kwargs['data']['email'] super(AccountDataEdit, self).__init__(*args, **kwargs) self.fields['default_cluster_id'] = forms.ChoiceField(choices=parsing.parse_cm_list(rest_data), label=_('Default CM')) self.fields['default_cluster_id'].widget.attrs['class'] = 'medium'