sultan
sultan

Reputation: 6058

Django: RadioSelect more granular control

I've a form

class DialogForm(forms.ModelForm):
    LISTING_CHOICES = ((1, _('Public')), (0, _('Unlisted')))

    first_question = forms.TextInput(attrs={'class': 'span4'})
    listing = forms.ChoiceField(widget=forms.RadioSelect, choices=LISTING_CHOICES)

I'm trying to get listing fields separately from template

{% for radio in dialog_form.listing %}
  {{ radio }}
{% endfor %}

But I got exception Exception Value: 'BoundField' object is not iterable

Django Version: 1.3.1

How to work with RadioSelect widget to access its rendered sub-elements?

Sultan,

Thanks.

Upvotes: 0

Views: 334

Answers (1)

Ben Rosnick
Ben Rosnick

Reputation: 148

I believe this is not possible in Django 1.3.1 Pretty sure you need version 1.4 to do this.

Upvotes: 1

Related Questions