NOOB: default value in the ChoiceField?

2007-02-27 Thread johnny
Is there a way to set the initial or default value in the ChoiceField? I need to set a default Country. For example: country = forms.ChoiceField(label='Country', choices=[(c.id,c.name) for c in Countrylist.objects.all()], def

Re: NOOB: default value in the ChoiceField?

2007-02-27 Thread Rubic
Use the 'initial' keyword arg: http://www.djangoproject.com/documentation/newforms/#initial -- Jeff Bauer Rubicon, Inc. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group,

Re: NOOB: default value in the ChoiceField?

2007-02-27 Thread johnny
I put in initial as a parameter. In the drop down list, or radio button, it does not highlight it anyway when you are at the page. If I look at the view source, it says, selected for drop down list and checked for radio button. Any idea why? On Feb 27, 5:50 pm, "Rubic" <[EMAIL PROTECTED]> wrot

Re: NOOB: default value in the ChoiceField?

2007-02-27 Thread johnny
It's working now. Thank you. On Feb 27, 8:52 pm, "johnny" <[EMAIL PROTECTED]> wrote: > I put in initial as a parameter. In the drop down list, or radio > button, it does not highlight it anyway when you are at the page. If > I look at the view source, it says, selected for drop down list and >