I'm passing a list because this is a formset, not a single form.
That code is part of a view function so I didn't show the def:
On Sep 17, 8:21 pm, Torsten Bronger
wrote:
> Hallöchen!
>
> On a second look, I see other things that may be problematic.
>
> Jim Myers
Hallöchen!
On a second look, I see other things that may be problematic.
Jim Myers writes:
> [...]
>
> class PhoneForm(forms.Form):
> telephoneType = forms.ChoiceField(required=True,choices=[])
> def __init__(self, *args, **kwargs):
> super(forms.Form, self).__init__(*args,
Hallöchen!
Jim Myers writes:
> [...]
>
> I have a Form with a ChoiceField where the choices are established
> by reading them from the database. Then I try to initialize the
> initial selected choice so it will be "selected" in the HTML. But
> nothing I tried works. [...]
I'm not sure
I'm spent hours reading docs and Googling for the solution to this
problem to no avail.
Running Django 1.1 with mod_wsgi
I have a Form with a ChoiceField where the choices are established by
reading them from the database. Then I try to initialize the initial
selected choice so it will be
4 matches
Mail list logo