On Apr 15, 7:10 am, Adam Yee <adamj...@gmail.com> wrote: > Can't get the forms.RadioSelect widget to render. I'm using svn > 10559, I've looked over forms/widgets.py, but I don't know... I'm > able to use forms.CheckboxSelect just fine. > > Is it Firefox giving me issues? What's going on here? > > #forms.py > class PollForm(forms.Form): > def make_fields(self, poll): > for c in poll.choice_set.iterator(): > self.fields[c.choice] = forms.CharField > (widget=forms.RadioSelect, label=c.choice) >
What is this make_fields? Where did you get it from? What calls it? If you want to create a dynamic field with choices from a queryset, the usual way to do this is in the __init__ method. And it won't work to declare a separate field for each choice. You want a single field for 'polls', with the choices set to poll.choice_set.all(). Even better, use a ModelChoiceField and use the queryset argument. -- DR. --~--~---------~--~----~------------~-------~--~----~ 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 django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---