Brian,
I tried this but still doesn't work:

//

class SurveyForm(ModelForm):
    experience = forms.ChoiceField(widget=forms.RadioSelect)

    class Meta:
        model = Survey

//

Nothing gets displayed in the template

On Mar 27, 9:32 pm, "Brian Armstrong" <[EMAIL PROTECTED]> wrote:
> On Thu, Mar 27, 2008 at 9:27 PM, Greg <[EMAIL PROTECTED]> wrote:
>
> >  Hello,
> >  My experience field by default gets displayed as a drop
> >  down..everything works fine when it is displayed this way.  However I
> >  want the field to be displayed in my template as Radio Buttons.  So I
> >  added the line ' experience =
> >  forms.CharField(widget=forms.RadioSelect) ' to my ModelClass.
> >  However, when I do this then my SATISFACTION choices don't get
> >  displayed in my template.
>
> >  My Models File
>
> >  SATISFACTION = (
> >     ('1', 'Agree'),('2', 'Disagree'),
> >  )
>
> >  class Survey(models.Model):
> >     experience = models.CharField(max_length=100,
> >  choices=SATISFACTION)
>
> >  ////
>
> >  My ModelForm class
>
> >  class SurveyForm(ModelForm):
> >     experience = forms.CharField(widget=forms.RadioSelect)
>
> >     class Meta:
> >         model = Survey
>
> >  ////
>
> >  Thanks for any help!
>
> Greg,
>
> I believe what you want is a ChoiceField in SurveyForm.
>
> --Brian
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to