I have a very simple ModelForm in my application that looks like this:
# ModelForm class ProductForm(ModelForm): class Meta: model = MyModel exclude = ['created', 'last_modified', 'serial_number']
And a form that looks like this:
# Form <form method="POST" action="{% url some_url %}"> {% csrf_token %} {{ formset.management_form }} {% for form in formset %} {% for field in form %} {% if field.errors %} <div>{{ field.errors }}</div> {% endif %} <div> {{ field.label_tag }}: {{ field }} </div> {% endfor %} {% endfor %} <div class="actions"> <input class="button submit focus" type="submit" value="{% trans "Save" %}" /> </div> </form>
When I look at a view using this, I just see a colon ( : followed by a text box: the label is gone.
According to the documentation for ModelForm :
In addition, each generated form field has attributes set as follows:
What mistake did I make?
I am using Django 1.4.1 if that matters.
NT3RP source share