How to use ChoiceField and ModelChoiceField with allauth Templates? #4152
-
I want to build a Custom SignUp Form which also includes ChoiceField and ModelChoiceField. Therefore I did the following adjustments: settings.py
accounts/models.py
accounts/forms.py
templates/allauth/elements/field.html
But I'm not sure about if this is correct, because options are only available in the template when passing 'initial' parameter in the form. Shouldn't this be provided by 'choices' or 'queryset' parameter instead? Is there an option to get the values from attrs object in a different way? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
I also stumpled upon this approach here https://forum.djangoproject.com/t/choicefield-default-to-show-no-value/25018 which also doesn't work for me but looks "more correct"
|
Beta Was this translation helpful? Give feedback.
-
I've fixed the rendering of |
Beta Was this translation helpful? Give feedback.
I've fixed the rendering of
<select>
over at 1eac57c