1
If you are working with Django, it has everything you will need to validate incoming data. The standard way to validate data with Django is through forms (and more specifically, form validation.)
From the docs:
Django’s role in forms
Handling forms is a complex business. Consider Django’s admin, where
numerous items of data of several different types may need to be
prepared for display in a form, rendered as HTML, edited using a
convenient interface, returned to the server, validated and cleaned
up, and then saved or passed on for further processing.Django’s form functionality can simplify and automate vast portions of
this work, and can also do it more securely than most programmers
would be able to do in code they wrote themselves.
You will find some helpful examples in the links that I’ve posted. I would recommend looking at the clean
method.
If the logic is mostly the same for each scenario, but with slight differences, you will likely be able to create a single form that can process the data appropriately based on what the user has selected.
Hope this helps.