I've been working in Django and Python for about a month. I'm trying to use radio buttons in a template, and I cannot get the radio buttons to be displayed on the page. Can anyone see what I'm doing wrong?
I'm running ActiveState Python 2.4 and Django 0.91 on Windows XP. In the view, I use a custom manipulator: VOTING_CHOICES = [('1','Yes'), ('-1','No'), ('0','N/A')] class CommentFormManipulator(formfields.Manipulator): def __init__(self): self.fields = ( formfields.TextField(field_name="title", is_required=True, maxlength=60), formfields.LargeTextField(field_name="text", is_required=True), formfields.RadioSelectField(field_name="s_accuracy", validator_list=VOTING_CHOICES, ) ) I put a pdb.set_trace() breakpoint before the call to return_to_response(), and examined form.fields. It looks like this: (Pdb) p form.fields [<FormFieldWrapper for "title">, <FormFieldWrapper for "text">, <FormFieldWrapper for "s_accuracy">] But the length of the field list is zero: (Pdb) x = form.fields[2] (Pdb) p x.field_list() <django.core.formfields.RadioFieldRenderer instance at 0x017CC530> (Pdb) p len(x.field_list()) 0 I put this code in the template: {% for option in form.s_accuracy.field_list %} {{ option.field }} {{ option.label }} {% endfor %} ...and nothing is printed out. I've tried just doing {{ form.s_accuracy }}, and that doesn't print out anything, either. I've searched for answers, and there are hints of other folks having problems with RadioSelectFields, but no postings of, "here, do exactly this, this code works." There aren't any outstanding tickets for this feature, so I'm doing something dumb. What is it? John --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---