Fixed #26729 -- Allowed overriding a form field's label/help_text in Form.__init__() for TabularInline.

This commit is contained in:
Paulo 2016-06-18 22:03:25 -04:00 committed by Tim Graham
parent ea4665066b
commit 9c2d5a8d33
3 changed files with 15 additions and 1 deletions

View file

@ -192,6 +192,10 @@ class SomeChildModelForm(forms.ModelForm):
'position': forms.HiddenInput,
}
def __init__(self, *args, **kwargs):
super(SomeChildModelForm, self).__init__(*args, **kwargs)
self.fields['name'].label = 'new label'
class SomeChildModelInline(admin.TabularInline):
model = SomeChildModel