Here's a minimal example example:
{{{
class ExampleForm(forms.ModelForm):
name = forms.CharField()
class Meta:
model = ExampleModel
fields = ('name', )
labels = {
'name': 'Test Label',
}
}}}
`ExampleForm().fields['name'].label` is None because `label` is not passed
into the overriding field declaration. Ideally, the lack of a field
attribute should result in label declared in `Meta.labels` being used
instead of prettifying it using `capfirst`. Alternatively, this can be
added to the documentation.
--
Ticket URL: <https://code.djangoproject.com/ticket/33093>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* status: new => closed
* resolution: => invalid
Comment:
It's documented in the "Note" box of
[https://docs.djangoproject.com/en/stable/topics/forms/modelforms
/#overriding-the-default-fields this section]: "Fields defined
declaratively are left as-is, therefore any customizations made to Meta
attributes such as widgets, labels, help_texts, or error_messages are
ignored; these only apply to fields that are generated automatically."
--
Ticket URL: <https://code.djangoproject.com/ticket/33093#comment:1>