Re: Initial data for a Select widget in newforms

2007-01-27 Thread Denis Frère
On Jan 27, 9:23 am, "canen" <[EMAIL PROTECTED]> wrote: > my_field = ChoiceField(choices=[(1, 1), (2, 2)], initial=1) > doesn't work? Yes, thank you. For information, here is more details. I have a view function called bill_clone to build a new bill form prepopulated with the values from a prev

Re: Initial data for a Select widget in newforms

2007-01-27 Thread canen
my_field = ChoiceField(choices=[(1, 1), (2, 2)], initial=1) doesn't work? On Jan 26, 7:04 pm, "Denis Frère" <[EMAIL PROTECTED]> wrote: > Hi all, > > I'm discovering newforms. > > It works pretty well, but I can't manage to give an initial selection > in a ChoiceField (Select widget). > I tried to

Initial data for a Select widget in newforms

2007-01-26 Thread Denis Frère
Hi all, I'm discovering newforms. It works pretty well, but I can't manage to give an initial selection in a ChoiceField (Select widget). I tried to read the code. I understand I have to give a "value" parameter to Select.render(), but how do I pass that value in the form initial data dictionary