mirror of
https://github.com/django/django.git
synced 2025-07-28 23:54:02 +00:00
Fixed #26729 -- Allowed overriding a form field's label/help_text in Form.__init__() for TabularInline.
This commit is contained in:
parent
ea4665066b
commit
9c2d5a8d33
3 changed files with 15 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue