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
>
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'
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
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
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
>
5 matches
Mail list logo