I need to โoverrideโ some of the classes of nested classes of the base class, leaving them intact.
This is what I do:
class InternGenericForm(ModelForm): class Meta: model = Intern exclude = ('last_achievement', 'program',) widgets = { 'name': TextInput(attrs={'placeholder': ' ' }), } class InternApplicationForm(InternGenericForm): class Meta:
In fact, I want InternApplicationForm.Meta
be exactly like InternGenericForm.Meta
, except that its exclude
tuple must contain one more element.
What is a prettier tool for this in Python? I'm sorry that I do not need to write boilerplate code, for example model = InternGenericForm.Meta.model
, which is also error prone.
source share