Re: initial argument in forms not working for me

2013-02-01 Thread Tom Evans
On Mon, Jan 28, 2013 at 5:35 AM, Nikhil Verma wrote: > Hi > > I am using django 1.4.3 and have a field in form > > > PROFILE_TYPE = ( > ('public', 'Public'), > ('private', 'Private'), > ) > profile_type = forms.CharField(max_length=10, widget=RadioSelect >

Re: initial argument in forms not working for me

2013-01-31 Thread Peter of the Norse
Weird HTML formatting in your message. Plain text fixes things. The issue is the capital P in initial='Public'. The choices list looks like (value stored in the database, value displayed to the user). The choices that the RadioSelect looks for from the datase are 'public' and 'private'. 'Public'

Re: initial argument in forms not working for me

2013-01-28 Thread Tim Akinbo
The initial parameter should be in the CharField method and not RadioSelect like you've specified it. Cheers. On Jan 28, 2013 6:35 AM, "Nikhil Verma" wrote: > Hi > > I am using django 1.4.3 and have a field in form > > > PROFILE_TYPE = ( > ('public', 'Public'), > ('private', 'Pr

Re: initial argument in forms not working for me

2013-01-28 Thread Sergiy Khohlov
I'm using dynamic initialization for this case . I've written a post in my blog about this long time ago : http://skhohlov.blogspot.com/2012/04/passing-values-from-view-to-form.html Many thanks, Serge +380 636150445 skype: skhohlov 2013/1/28 Nikhil Verma : > Sorry I made a typo in last email

Re: initial argument in forms not working for me

2013-01-27 Thread Nikhil Verma
Sorry I made a typo in last email . Can anybody explain what mistake i am doing ? Hi I am using django 1.4.3 and have a field in form PROFILE_TYPE = ( ('public', 'Public'), ('private', 'Private'), ) profile_type = forms.CharField(max_length=10, widget=RadioSelect >