I've got a formset:
FormSet = inlineformset_factory(
User, Profile,
fields=('mychoice',),
widgets={
'mychoice': Select(choices=CHOICES)
},
labels={
'mychoice': _('mychoices:')
}
)
class ProfileDisplay(DetailView):
template_name = 'profile.html'
model = User
def get(self, request, *args, **kwargs):
form = self.get_form()
profile_form = ProfileFormSet(instance=self.request.user)
return self.render_to_response(
self.get_context_data(form=form, profile_form=profile_form)
)
<form method="POST" action=".">
<fieldset class="profile">
{{ profile_form.management_form }}
{% for form in profile_form %}
{% for field in form %}
{{ field }}
{{ field.label_tag }}
{% endfor %}
{% endfor %}
</fieldset>
</form>
The problem is that label is not shown on the page, I'm getting only:
<select name="profile-0-mychoice" id="id_profile-0-mychoice">
<option value="True" selected>mychoice true</option>
<option value="False">mychoice false</option>
</select>