what work clean_data does?
What work clean_data does?
Hello Yashu, clean_data is like dictionary that stores your data that you save in the form. It’s like you have the form containg username and email then cleaned_data will be the dictionary instance that has ‘username’ : usernamefilled,‘email’ : emailfilled
So basically when we use model forms it is generally not required as it stores the vaidated data. So in model form we always get the vaidated data at the end but if we implement simple form then we need to validate every field and then create the object related to those fields and then save it in the database.
I hope it is clear to you, pls ask if anything is not clear to you or seems confusing, I will try to help you out.
In case it is clear to you pls mark it as resolve and pls provide the rating as well as feedback so that we can improve ourselves.
Thanks
Happy Coding !!
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.