>>> 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.append(l1)
>>
>> data = {'myfield':'nothing',}
>>
>> form = MyForm(data)
>> form.base_fields['myfield'].widget=widgets.Select(choices=C)
>>
>>
>> The Select gets filled fine with the users data
>> But I can't find how to add the Selected user to the <SELECT> tag.
>>
>> By default shows the first user in the query.
>>
>> I hope I've made more clear.
>>
>>
>> Thank you very much
>>
>>
>> Leonel
>>
>
>
> Don't know if this is valid but is working Ive added this
>
> z = '%s selected=selected' % selecteduid
> CA.insert(0, {z,'the selected user'})
>
> And is working ..
>
> Saludos
>
> Leonel
>
>
No, doesn't work, displays fine but when I submit the form I get the value
with the selected=selected..
..
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---