Unfortunately, I believe they're necessary.  My exact code is a list of
radio inputs, in template lanaguage and radio buttons use the input
name as a way of grouping.

My Models would be:
class OptionSet(Model):
   name = CharField()

class Option(Model):
   name = CharField
   option_set = ForeignKey(OptionSet)

clas Item(model):
   options = ForeignKey(OptionSet)

{% for option_set in item.get_options %}

<h1>{{option_set.name}}</h1>
{% for option in option_set.get_choices %}
<input type="radio" name="option[{{option_set.id}}]"
value="{{option.id}}"> {{option.name}}
{% endfor %}
{% endfor %}

Which once translated would look like:

Color
--------
o Blue
o Red
o Green

Size
------
o Small
o Medium
o Large

Reply via email to