You must be a teacher. These series are excellent.
@narottamaswal39784 жыл бұрын
Thank you so much for this series. Please make a tutorial on formsets and formsets with classes too
@veryacademy4 жыл бұрын
Noted! Thank you - added to the list - cant promise when 👍
@jandeswart13784 жыл бұрын
The slugify-explanation may be off-topic, but was still very usefull to me.
@XavierLarrea2 жыл бұрын
to make this video more complete I would solve the email send issue and I would add and autofill of username and email in the form when the user is already validated
@afaf64784 жыл бұрын
Really good video! I
@veryacademy4 жыл бұрын
Thanks!
@vinay__baliyan4 жыл бұрын
Does formview not return validation errors in form? Like password is too short
@veryacademy4 жыл бұрын
Formview can check is data is valid. def form_valid(self, form): # This method is called when valid form data submitted. You could then check the data further. return super().form_valid(form) You can setup all the simple validation you referred to in form.py
@vinay__baliyan4 жыл бұрын
@@veryacademy Thank you. This I am using and it's working fine. Although I was hoping to use def form_invalid() in some way to put out validation errors as messages. Form_invalid is called form data does not look okay. I need to find a way to see what caused a validation error and then render it on page via messages.
@vicky3333ful3 жыл бұрын
@@vinay__baliyan you can use it this way def form_invalid(self, form): messages.error(request, form.errors) super(yourformclass, self).form_invalid(self, form)
@vinay__baliyan3 жыл бұрын
@@vicky3333ful Thank you. I will give it a try.
@omotayoofere874 жыл бұрын
Thanks for the tutorial. I'd like to ask, upon doing a custom check on my form (under the forms.py) and saving it, can I still come check for validation of the form (under views.py through the form_valid method as you did here? Wouldn't that create a duplicate of the form in the database? I'd like you to suggest a better way to check for a condition on my forms before validating it and eventually saving it if my above method isn't very professional. Thanks in advance.
@veryacademy4 жыл бұрын
Hey Omotayo, in general terms form / data validation can be done in the model.py, in the form.py, in the view and on the front-end. I wont commit to the answer because, there will be many opinions how to best perform and conduct validation some might be dependant on workflow, principles, working practices. You might follow for example - MVC, where principles suggest that anything that uses/interacts with the database should/might be in the model layer. It is generally considered good practice to keep the view as slim as possible - therefore As a general guideline, move as much as possible of the business logic to the separate areas, again using models.py forms.py)
@fowad273 жыл бұрын
in the video you mentioned that adding to database is best not done using form views but rather another type of view, and that you would cover it in a future video. Which view is that, and can you point me to that other video where you covered that? Also, if I want to do multiple actions with a form, adding to an object to the model the form is built on as well as sending and email to a different model object, should I be using forms or is there a better way?
@mueezkhan2803 жыл бұрын
i think that view is createView. please share the solution (if you find out) about "multiple actions with a form".
@girishgirijan99002 жыл бұрын
Thank you.
@veryacademy2 жыл бұрын
You're welcome!
@ekeredtv2 жыл бұрын
fantastic
@CharlesESBoimah Жыл бұрын
I Need Your Help How can get to You
@bourkimohamed10683 жыл бұрын
hello my frind what about multiple Forms in one class views
@rangabharath42534 жыл бұрын
Awesome 😎
@veryacademy4 жыл бұрын
Thanks Ranga, have good day.
@bangnl3 жыл бұрын
FormView displays a form but not a form page??? I don't understand this
@bourkimohamed10683 жыл бұрын
display mor then one form i try mush think but donsnt work please giv me some ediat or vedio