mirror of
https://github.com/django/django.git
synced 2025-10-24 06:06:09 +00:00
Fixed #26729 -- Allowed overriding a form field's label/help_text in Form.__init__() for TabularInline.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user