i'm trying to write csv importer for my project that i can use for any model, it should be a wizard that first you upload the csv file, in the second step it generates a form based on the csv file for mapping csv field with database fields, on the first call to the form i should specify the model for the mapping, that can be a hidden input in the first form. on the other hand i want to use ajax for all the process, i don't know what to use exactly so it would be a complete reusable module and also with writing less java-script also how should i generate the second dynamic form. thanks.
Submit the first form through ajax. The request will contain (hidden) which form to use, so just render that form (based on a ModelForm). Make a template for each possible form(model) and return the rendered template accordingly. The ajax call will remove the first form, on success and replace it with the response (which will be the second form).