def __init__(self, *args, **kwargs): super(ServiceSettingsAdminForm, self).__init__(*args, **kwargs) self.fields['type'] = ChoiceField( choices=SupportedServices.get_choices(), widget=RadioSelect) self.fields['username'] = CharField(widget=forms.TextInput( attrs={'autocomplete': 'off'})) self.fields['password'] = CharField(widget=PasswordWidget( attrs={'autocomplete': 'off'}))
def lookups(self, request, model_admin): return SupportedServices.get_choices()
def __init__(self, *args, **kwargs): super(ServiceSettingsAdminForm, self).__init__(*args, **kwargs) self.fields['type'] = ChoiceField( choices=SupportedServices.get_choices(), widget=RadioSelect)