for field in FIELDS:
row = []
row.append("<tr>")
row.append("<td>" + str(myform.fields.get(field)) + "</td>")
row.append("</tr>")
custom_fields.append("".join(row))
When I give the custom_fields
variable to the template, all I'm getting is:
<tr><td><django.forms.widgets.CheckboxInput object at 0x1fa7d90></td></tr>
How can I get the form rendered properly?
This is what I'm going to be doing eventually:
form1 = CustomForm1()
form2 = CustomForm2()
form3 = CustomForm3()
for field in FIELDS:
row = []
row.append("<tr>")
row.append("<td>" + str(form1.fields.get(field)) + "</td>")
row.append("<td>" + str(form2.fields.get(field)) + "</td>")
row.append("<td>" + str(form3.fields.get(field)) + "</td>")
row.append("</tr>")
custom_fields.append("".join(row))
So I can display all form fields together in one table.