Learn Django Class Based Views - FormView - Theory and Examples

  Рет қаралды 17,390

Very Academy

Very Academy

Күн бұрын

Пікірлер: 25
@onyeibo
@onyeibo 2 жыл бұрын
You must be a teacher. These series are excellent.
@narottamaswal3978
@narottamaswal3978 4 жыл бұрын
Thank you so much for this series. Please make a tutorial on formsets and formsets with classes too
@veryacademy
@veryacademy 4 жыл бұрын
Noted! Thank you - added to the list - cant promise when 👍
@jandeswart1378
@jandeswart1378 4 жыл бұрын
The slugify-explanation may be off-topic, but was still very usefull to me.
@XavierLarrea
@XavierLarrea 2 жыл бұрын
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
@afaf6478
@afaf6478 4 жыл бұрын
Really good video! I
@veryacademy
@veryacademy 4 жыл бұрын
Thanks!
@vinay__baliyan
@vinay__baliyan 4 жыл бұрын
Does formview not return validation errors in form? Like password is too short
@veryacademy
@veryacademy 4 жыл бұрын
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__baliyan
@vinay__baliyan 4 жыл бұрын
@@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.
@vicky3333ful
@vicky3333ful 3 жыл бұрын
@@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__baliyan
@vinay__baliyan 3 жыл бұрын
@@vicky3333ful Thank you. I will give it a try.
@omotayoofere87
@omotayoofere87 4 жыл бұрын
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.
@veryacademy
@veryacademy 4 жыл бұрын
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)
@fowad27
@fowad27 3 жыл бұрын
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?
@mueezkhan280
@mueezkhan280 3 жыл бұрын
i think that view is createView. please share the solution (if you find out) about "multiple actions with a form".
@girishgirijan9900
@girishgirijan9900 2 жыл бұрын
Thank you.
@veryacademy
@veryacademy 2 жыл бұрын
You're welcome!
@ekeredtv
@ekeredtv 2 жыл бұрын
fantastic
@CharlesESBoimah
@CharlesESBoimah Жыл бұрын
I Need Your Help How can get to You
@bourkimohamed1068
@bourkimohamed1068 3 жыл бұрын
hello my frind what about multiple Forms in one class views
@rangabharath4253
@rangabharath4253 4 жыл бұрын
Awesome 😎
@veryacademy
@veryacademy 4 жыл бұрын
Thanks Ranga, have good day.
@bangnl
@bangnl 3 жыл бұрын
FormView displays a form but not a form page??? I don't understand this
@bourkimohamed1068
@bourkimohamed1068 3 жыл бұрын
display mor then one form i try mush think but donsnt work please giv me some ediat or vedio
Learn Django Class Based Views - CreateView - Theory and Examples
12:25
Learn Django Class Based Views - RedirectView - Theory and Examples
21:57
How to have fun with a child 🤣 Food wrap frame! #shorts
0:21
BadaBOOM!
Рет қаралды 17 МЛН
КОНЦЕРТЫ:  2 сезон | 1 выпуск | Камызяки
46:36
ТНТ Смотри еще!
Рет қаралды 3,7 МЛН
The most POWER they have given us SO FAR!
1:03:33
PowerApps Tutorial
Рет қаралды 1,5 М.
10 Signs Your Software Project Is Heading For FAILURE
17:59
Continuous Delivery
Рет қаралды 19 М.
Python Django - Build Inline Formsets (with CBV's) Example 1
1:47:49
Very Academy
Рет қаралды 38 М.
Learn Django Class Based Views - ListView - Theory and Examples
21:59
Learn Django Class Based Views - UpdateView - Theory and Examples
15:28
REST API Crash Course - Introduction + Full Python API Tutorial
51:57
What is Laravel & Why You Should Learn It | Learn Laravel The Right Way
6:58
Javascript's New Pipeline Operator Is Awesome!
7:26
Jack Herrington
Рет қаралды 43 М.
AI Is Making You An Illiterate Programmer
27:22
ThePrimeTime
Рет қаралды 166 М.