Closed flvyu closed 4 years ago
I created a ModelForm view along the lines you mention: b17e83e8372ac509bf2bf61ba452aed0d1e1e17f
However, I am unable to replicate this with Django 3.0. Can you create a fork with an example?
I also could not reproduce it using the fork I made of the branch. However, still having the issue on the other application.
Ah okay. I'm closing this issue for now, feel free to reopen if you can reproduce it with our test project.
Just wanted to say -- I was having similar issues. You have to use {{ form.phone }}
, you can't try to do things like constructing your own custom form and extracting {{ form.phone.id_for_label}}
. My client page was sending phone
in the post request instead of phone_0
and phone_1
like the ModelForm was expecting.
I have created a model with a phone_number field like the following:
However when I use this model to create a ModelForm, the form has an error when
is_valid
is called saying that phone number is required even though the data is passed to the request. All the other fields that are required work fine.Ex:
Environment: django 3.0 Python 3