initial works for me, however, you must set the initial by the id of the
record not the instance, i.e.

forms.ModelChoiceField(queryset=Bullet.objects.filter(fk_day=day_id),
initial = Bullet.objects.get(pk = day_id).id)

-richard



On 9/17/07, Rufman <[EMAIL PROTECTED]> wrote:
>
>
> how can i make one of the options in a select the default. (i
> previously changed the select widget so that it only shows a selection
> of options).
>
> my code:
> ModifyComment.base_fields['fk_bullet'] =
> forms.ModelChoiceField(queryset=Bullet.objects.filter(fk_day=day_id))
>
> i what one of the options in the querset to be the default or initial
> value. using initial doesn't work with ModelChoiceFiel. Does anyone
> know which other attribute i could use?
>
> stephane
>
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to