Answer the question
In order to leave comments, you need to log in
How to change an individual field in a form?
I have a problem with the form. The form is normal, not model. In View, I have a function that takes a form (it has 5 fields), calculates the required value, and I need to write this value into one field of the very form that the user sent me, then send this entire form back. So, the question is: "How can I change the value of only one field in the form that I received from the user using the Post method?" I tried, but I can’t access only one field, if the entire form was one field, then we could use .clean ()
form = IpForm(request.POST)
if form.is_valid():
*выполняется просчет значения*
#тут необходимо записать полученное значение в поле формы с name = 'cidr'
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question