Hello:
I'm using
form.base_fields['MYFIELD'].widget=widgets.Select(choices=CA)
to fill a tag, all works fine but I can't find how to add a
SELECTED value, been with this issue all day ..
Thank you
leonel
--~--~-~--~~~---~--~~
You received this message
Can you give a more detailed example of your code?
On Sep 21, 3:25 am, "Leonel Nunez" wrote:
> Hello:
>
> I'm using
>
> form.base_fields['MYFIELD'].widget=widgets.Select(choices=CA)
>
> to fill a tag, all works fine but I can't find how to add a
> SELECTED value, been with this issue all day
I too spent a day or so on this seemingly simple problem :(
Here's my solution...
class EMailAddressForm(forms.Form):
emailType = forms.ChoiceField(required=True,choices=[])
def __init__(self, *args, **kwargs):
super(forms.Form, self).__init__(*args, **kwargs)
choices =
> Can you give a more detailed example of your code?
>
This is what basically I'm doing:
class MyForm(forms.Form):
myfield = forms.CharField(widget=forms.Select)
C =[]
u = User.objects.all()
for r in u:
l1 = []
l1.append(r.id)
l1.append(r.username)
C.ap
> I too spent a day or so on this seemingly simple problem :(
> Here's my solution...
>
> class EMailAddressForm(forms.Form):
>
> emailType = forms.ChoiceField(required=True,choices=[])
>
> def __init__(self, *args, **kwargs):
> super(forms.Form, self).__init__(*args, **kwargs)
>
>> Can you give a more detailed example of your code?
>>
>
> This is what basically I'm doing:
>
>
> class MyForm(forms.Form):
> myfield = forms.CharField(widget=forms.Select)
>
>
> C =[]
> u = User.objects.all()
> for r in u:
> l1 = []
> l1.append(r.id)
> l1.append
>>> Can you give a more detailed example of your code?
>>>
>>
>> This is what basically I'm doing:
>>
>>
>> class MyForm(forms.Form):
>> myfield = forms.CharField(widget=forms.Select)
>>
>>
>> C =[]
>> u = User.objects.all()
>> for r in u:
>> l1 = []
>> l1.append(r.id)
>>
7 matches
Mail list logo