How can I convert string into Form?
in model you can just use this line.
model = apps.get_model(app_label='app_label', model_name='str_model')
I have 3 forms namely:
- Fund_customer
- Fund_employee
- Fund_supplier
and would like to do this.
type = "customer"
form = "Fund_"+type #that would make "Fund_customer"
form = apps.get_form(form) #I wonder if there's a function like this.
I just dont want to do if condition to achieve this.