I am creating a form in Django. When I POST the data, the data is naturally sent. My problem is, I want to pass an additional property to the POST data, that is not any of the form fields, but an additional one.
So that I can later do something like (pseudocode):
def form_view(request):
if request.method == 'POST':
form = MyForm(request.POST)
if form.is_valid():
extra_field = form.cleaned_data['extra_field']
#or maybe
extra_field = form.extra_field
#...
else:
form = MyForm()
#...
Anything that might work in order to pass an extra property, which is not a field but a simple variable, to the POST request.
If you want to pass anything to django as a POST request from the HTML, you would use a hidden input
If you want to modify the POST dictionary in python from your view,
copy()it to make it mutable.