Hi I tried to do validation for email to check if it exist or not .... the raise not working properly it render the same page with all fields except email its empty ... can you help ? I need to show a message that the email is exist
Hi, you have declared the functions def clean_email(self) and def clean_title(self) ; but where are you calling them ? I tried running it as is, but no validation error is being thrown on an invalid input Thanks in advance
Thanks Justin I like your videos as I am learning django myself and they provide good reference points. One question i have for validating forms is how to check for duplicates. I have tried using unique_together in the models but it is causing an error and im not sure why. Do you have a suggestion on the best way to validate for duplicate entries? e.g. only one book instance can be added to a library database.
so.. i have a field to put in Chinese name and a field to put in English name. How should I do the validation for checking if the user is inputting a Chinese name in the field?
Hi I am getting Value Error, Snippet didn't validate after submitting form.Please help in resolving this error, I am not getting any solution from anywhere. If I remove the code for raise ValidationError, no error is coming. I am using Django 2.2
In Django 1.10, required form fields now have the required HTML attribute which causes HTML5 form validation to occur and any custom error messages you might want to display are never displayed to the user since the page isn't even POSTed back to the server. I would like to have seen this problem addressed here. Perhaps it's in another video?
with this form, how can I send an email form.cleaned_data['email'] to the User and to the Admin with telling them corresponding messages? For example: When the user writes in his questions and gives his E-mail -> Your question was accepted, we will get in touch with you soon! For the Admins ---> You have a new question to answer for a new user!
Hi everyone. I am in a project and I was asked to validate dates. For example, I have two dates: one is for input, the other one is for output. The user must entry the input date the the output date. I want the system could alert the user if he entries, as output date, a date tha is earlier that the input date. So, I think there must be a comparison between both dates. I'm working with django and the forms are on html. I need someone could help me, please... it's an emergency!!! u.u
so why do we need 'forms.ModelForm' instead of just 'forms.Form' .. if in both we can get the same validations ? what is the difference of them ? where to use one - another
forms.Form is a kind of a manual setup of what forms.ModelForm does. You can think of forms.Form as having more freedom for implementing custom features of your form.
So, here, we override the "clean_()" method that is in the "ModelForm" class that we inherited from. So, we cannot change its name like "cleans_title()" or "clean_tit()". It has to be as it is. Right?
Man you really fucked up this tutorial with forms. The tutorial was going great until you started copying and pasting stuff from form to form. I still have no idea what that create view is doing. Nothing.
Hey champ, I get an Value Error. "The view xxxx.views.xxxxx didn't return an HttpResponse object. It returned None instead" Any Idea how I can fix that?
What I like about these tutorials is they get straight to the point. There is no subscribe msg before-hand. Also, they contain lots of information.
I was looking for this all day, thank you and you're awesome!
Hi
I tried to do validation for email to check if it exist or not .... the raise not working properly it render the same page with all fields except email its empty ... can you help ?
I need to show a message that the email is exist
Waiting for the next tutorial!
Thanks
Hi, you have declared the functions def clean_email(self) and def clean_title(self) ; but where are you calling them ? I tried running it as is, but no validation error is being thrown on an invalid input
Thanks in advance
how would u validate many to many fields in django form?
Great. Straight to the point. Solid work. Congratulations
Thank you sir, Today I got my doubt cleared
Which one is more useful ? forms.ModelForm or forms.Form ?
Good morning a question how could I validate that a field is unique in the @t since it does not use models ? Thanks
Thank you. Actually explained it clearly.
as always, You are awesome bro ........
How can we validate the format of a file(.txt,.csv, or any kind of format) which is uploaded by the user?
If I want string or number in the title field then I do?
Are both RawProductForm and ProductForm necessary for saving data into the database. Can anyone of them only cannot save the data?
Thanks Justin I like your videos as I am learning django myself and they provide good reference points.
One question i have for validating forms is how to check for duplicates. I have tried using unique_together in the models but it is causing an error and im not sure why. Do you have a suggestion on the best way to validate for duplicate entries? e.g. only one book instance can be added to a library database.
"email" is not in the Product model, will it save if you leave the code like this? (assume valid email and valid form)
No it will not saved anywhere.
so.. i have a field to put in Chinese name and a field to put in English name.
How should I do the validation for checking if the user is inputting a Chinese name in the field?
Nice class .thank u
How can I validate the size of a file in a modelform?
Hi I am getting Value Error, Snippet didn't validate after submitting form.Please help in resolving this error, I am not getting any solution from anywhere. If I remove the code for raise ValidationError, no error is coming. I am using Django 2.2
In Django 1.10, required form fields now have the required HTML attribute which causes HTML5 form validation to occur and any custom error messages you might want to display are never displayed to the user since the page isn't even POSTed back to the server. I would like to have seen this problem addressed here. Perhaps it's in another video?
my cleaned_title function does not work any solution?
how can we validate a custom html form in django?
my cleaned_title function does not work any solution?
Is their any tutorial on setting email in django(filebased, SMTP based, Console based) and how to use it
Somewhere yeah! Do a search on joincfe.com for setting up email.
with this form, how can I send an email form.cleaned_data['email'] to the User and to the Admin with telling them corresponding messages?
For example:
When the user writes in his questions and gives his E-mail -> Your question was accepted, we will get in touch with you soon!
For the Admins ---> You have a new question to answer for a new user!
Hi everyone. I am in a project and I was asked to validate dates. For example, I have two dates: one is for input, the other one is for output. The user must entry the input date the the output date. I want the system could alert the user if he entries, as output date, a date tha is earlier that the input date. So, I think there must be a comparison between both dates. I'm working with django and the forms are on html. I need someone could help me, please... it's an emergency!!! u.u
so why do we need 'forms.ModelForm' instead of just 'forms.Form' .. if in both we can get the same validations ? what is the difference of them ? where to use one - another
forms.Form is a kind of a manual setup of what forms.ModelForm does. You can think of forms.Form as having more freedom for implementing custom features of your form.
Validation for email is not working in my form plz plz plz help
How the function is called in forms.py with just defining ?
Is not just defined, the forms are imported in views.py
@@pabloosorio6647 how def clean_title(): is performed in class productform
Without calling it
@@pabloosorio6647 it has to be called with product form.clean_title(arguments)
@@pabloosorio6647 please clarify my doubt
@@deepakchowdary542 I understand that Django calls it automatically, without you having to explicitily write it in your code.
Validation not working. Solution please.
So, here, we override the "clean_()" method that is in the "ModelForm" class that we inherited from. So, we cannot change its name like "cleans_title()" or "clean_tit()". It has to be as it is. Right?
Ameer Abdulaziz correct. You can only change the field name and nothing else.
nice video
Not working validation in django 2.1 python 3above
this would work----> title = self.cleaned_data['title']
Validation is not working, justin?
Thank you!!!!
hi justin, search channel "Bhutan Tutor", FYI.
Thank you!
Great tutorial, but please just show one way. All these other ways, and you could do it this way, but... stuff is a pain in the ass.
+
Man you really fucked up this tutorial with forms. The tutorial was going great until you started copying and pasting stuff from form to form. I still have no idea what that create view is doing. Nothing.
Hey champ, I get an Value Error.
"The view xxxx.views.xxxxx didn't return an HttpResponse object. It returned None instead"
Any Idea how I can fix that?