Hi,

Need help in understanding the template rendering for radio/check
buttons

1. Is it possible to display the radio/check buttons in horizontal or
customized(as per user interest) order.
2. How do I get the control on the radio button attribute/variable in
templates. (Instead of just printing the {{ FAMILY.family_value }} I
would like to loop the attribute/variable)
3. Is it possible to get rid of <ul> <li> tags while getting the
values of a variable or attribute of a form.

Code is given below

forms.py:
class FamilyForm(forms.Form):
   family_value = forms.IntegerField(widget=forms.RadioSelect
(choices=family_value_filler(family_value_list)))

views.py:
def family_view(request, template_name="family.html"):
   family_form = FamilyForm()
   return render_to_response(template_name, {'FAMILY': family_form})

family.html:
<tr>
<td>family_value:</td>
<td>{{ FAMILY.family_value }}</td>
</tr>

output: Radio buttons displayed in vertical order.
<ul>
<li><label for="id_family_value_0"><input type="radio"
id="id_family_value_0" value="0" name="family_value" /> Doesn&#39;t
Matter</label></li>
<li><label for="id_family_value_1"><input type="radio"
id="id_family_value_1" value="1" name="family_value" /> Liberal</
label></li>
<li><label for="id_family_value_2"><input type="radio"
id="id_family_value_2" value="2" name="family_value" /> Moderate</
label></li>
<li><label for="id_family_value_3"><input type="radio"
id="id_family_value_3" value="3" name="family_value" /> Traditional</
label></li>
</ul>


Thanks for your time.

Regards,
Lokesh
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to