I'am new to OOP in python and trying to use a class variable within the django framework. I need to call the class variable required and input it in the Charfield method like tihs:
class customerForm(forms.Form):
def __init__(self, required=True):
self.required = required
name = forms.CharField(label='Name', max_length=20)
first_name = forms.CharField(label='First Name', max_length=50, required=)
last_name = forms.CharField(label='Last Name', max_length=50, required=)
company_name = forms.CharField(label='Company Name', max_length=50, required=)
address = forms.CharField(label='Address', max_length=100, required=)
city = forms.CharField(label='City', max_length=50, required=)
How can I do this?