I'm working on Django application where I need to render a form differently.
The form contains multiple fields related to a person.
1. Firstname
2. Lastname
3. Email
4. Address
5. City
6. Country
7. Phone
8. Pincode
There are two flows in my application. In the first flow I can render all the form fields and save them when the user enters some data and submit.
But in the second flow, I need to display only three fields as below.
1. Name - *Combination of Firstname and Lastname*
2. Email
3. Phone
The data entered in the name field should be split by empty space - and saved as Firstname and Lastname. And for other remaining mandatory fields in the form that are not rendered, I can fill empty values and save the model in Backend.
What is the best way to render the forms differently for each flow?
Python: 3.7.3
Django: 2.1.5