Re: Setting the value of the select box for a ModelChoiceField

2008-08-26 Thread ydjango
Use initial, where 1 is my db key, field1 = forms.ModelChoiceField(..., initial=1,...) On Aug 25, 4:38 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > Hi, > > I am using theModelChoiceFieldto provide a filtered set of choices > on a profile form and I was wondering how I can set the initial

Setting the value of the select box for a ModelChoiceField

2008-08-25 Thread [EMAIL PROTECTED]
Hi, I am using the ModelChoiceField to provide a filtered set of choices on a profile form and I was wondering how I can set the initial value of the select box. In other words I want to set the initial value of the form to the value retrieved from the database when a person is editing or updati