Python Django - Build Inline Formsets (with CBV's) Example 1

  Рет қаралды 38,410

Very Academy

Very Academy

Күн бұрын

Пікірлер: 120
@seans_travels
@seans_travels 2 жыл бұрын
oh my god, you have no idea how helpful this was to me!!! I watched about 100 different tutorials and did 1000 google searches but I couldnt get my inline form to work right and connect the 2 tables on one page. WOW, you finally showed me!!!!!! I am forever in your debt.
@lauderday8
@lauderday8 3 жыл бұрын
What can I say. Two weeks ago I spent about 2 or 3 days figuring out inline formsets and then this wonderful video comes out. Watched it anyways along with almost all the other Django videos of yours since I found the channel about a week ago. Great stuff, thanks a lot for taking your time and making those awesome videos!
@veryacademy
@veryacademy 3 жыл бұрын
Thanks Lauder - hopefully it was useful, like I said to the others, I will expand on this shortly with 3 models.
@hoschi60
@hoschi60 Ай бұрын
​​@@veryacademy great stuff there! Thanks for the tutorials and the great work! Did you evetually expand this tutorial to 3 models?
@rasmusarvidsson2590
@rasmusarvidsson2590 2 жыл бұрын
Just watched almost the whole class based views series. Thank you so much for creating it!! Amazingly good!
@veryacademy
@veryacademy 2 жыл бұрын
Thank you!
@carewen3969
@carewen3969 3 жыл бұрын
You, Sir, are a legend! Your teaching style and pace are excellent. Your organization of concepts is outstanding. I followed along and was able to apply this to my own particular project, in large part due to how you approach the entire experience. Thank you. Inline Formsets is of the two big concepts I needed to get my head around for this web application I'm working on. And getting repeating forms in Class Based Views is excellent.
@veryacademy
@veryacademy 3 жыл бұрын
Thanks Carewen appreciate the positive feedback. Good luck with your project 👍
@kamilr.2435
@kamilr.2435 2 жыл бұрын
Brilliant work, one of the best YT tutorial about programming problem i have ever watch. I also spent 2 days figuring out inline formsets, but found that gem and almost everything works for me!
@genericnamethingy
@genericnamethingy 3 жыл бұрын
You have no idea how many things this cleared up for me. Thank you!
@sebastienlefloch3767
@sebastienlefloch3767 2 жыл бұрын
Thank you for this tutorial. At the end, you talked about a second example with 3 models. I hope that you can do it because it is very tricky.
@veryacademy
@veryacademy 2 жыл бұрын
I didn't make it after all that, sorry about that.
@sebastienlefloch3767
@sebastienlefloch3767 2 жыл бұрын
Perhaps for a future video 🙏
@romanhrobot9347
@romanhrobot9347 2 жыл бұрын
@@veryacademy Pretty please
@alejandroeliasdiazorellana257
@alejandroeliasdiazorellana257 2 жыл бұрын
I have one or two years look for a solution like this, i see your video but i dont i understand. Today i can say, you are the best, thank a lot man, if you come to Chile, send me a message i will happy to meet you,
@jeancharlles9
@jeancharlles9 3 жыл бұрын
Excellent video! You helped me a lot to use CBV for this type of form. I would like to see the video with example 2, using inline formset with 3 tables. Grateful!
@rayt7338
@rayt7338 3 жыл бұрын
TY we need more tutorials like yours.....
@marcdanon1419
@marcdanon1419 3 жыл бұрын
First time I comment a KZbin video and I must have seen a thousand Django tutorials... Many many many thanks for your time and dedication teaching us all these amazing stuff in such a thorough way. Your CB views tutorials are absolutely great. By any chance would you consider making a serie about Django Rest Framework without React? Or a beginner React tutorial? Again many many thanks
@LeetCodeMastery-y9d
@LeetCodeMastery-y9d Жыл бұрын
1. Thank you 2. I think that the part where you are start to explain about the inlineforest is a little bit comfuse, maybe it's better to add picture that seminstrate how this class is working ( like you showed us in the beggining) 3. All the part where we anable the user to edit the Author's detail by using "AuthorBooksEditView" is a little bit confusing Again thanks a lot and I I waiting for more good videos like that !
@tonnjeremiah8035
@tonnjeremiah8035 3 жыл бұрын
Great video and just what I needed for my current project. I look forward to the next tutorial with the additional model added in.
@abdelmajidalahyane3492
@abdelmajidalahyane3492 Жыл бұрын
Thank you so much for this tutorial. Is there a way to costumize the same form but inside the admin panel ?
@veryacademy
@veryacademy Жыл бұрын
Sure, a form is a form, after all.
@onyeibo
@onyeibo 2 жыл бұрын
You are an excellent teacher😍😍
@veryacademy
@veryacademy 2 жыл бұрын
Thank you
@afaf6478
@afaf6478 3 жыл бұрын
Woohoo! I am so excited about this video!!!!
@veryacademy
@veryacademy 3 жыл бұрын
Hopefully it is useful - I had a real think about how to start this - sorry there is so much setup for this type of demonstration - I tired to cover the basics all with CBV's - I will follow this up with a very advanced 3 model setup. Just let me know when. The second part will follow on from here so we wont need any initial setup and can get straight into it.
@afaf6478
@afaf6478 3 жыл бұрын
@@veryacademy As I said before there is not much in terms of inline formsets with CBV online. Anything that is current (Django 3) and CBV is very helpful. Django has a lot of cool built-in features and I prefer to use the included functionality before introducing 3rd party packages. Forms and formsets are fundamental to any online app but this topic is so complicated that it is hard to know what exactly I should start learning. Intro to CBV was a good starting point and forms seems like a logical continuation of that topic.
@AcademyOmen
@AcademyOmen 3 жыл бұрын
@@afaf6478 Your Right 🔥🔥🌍🌍
@ryanthomas1609
@ryanthomas1609 3 жыл бұрын
Very interesting and useful, eagerly waiting for the more challenging part 2
@alexforget
@alexforget 2 жыл бұрын
Thank you, I learn so many new tricks by watching you. That will reduce the amount of code I need for my projects.
@michaelweintraub7461
@michaelweintraub7461 2 жыл бұрын
Thank you for creating this video. It was helpful. You have good pacing and kept the material interesting.
@wazidmalik6824
@wazidmalik6824 2 жыл бұрын
Is example 2 is also available of this topic ?
@salmaahmed2171
@salmaahmed2171 2 жыл бұрын
Well done, pal! Love it ❤️‍🔥
@atchutram9894
@atchutram9894 3 жыл бұрын
Wonderful video. I want to watch your other Django tutorials now. Please make a video on Django MPTT if possible.
@rubendariohernandezcenteno5259
@rubendariohernandezcenteno5259 2 жыл бұрын
How could I create an Author and add their Books in the same form?
@yukselbastan4687
@yukselbastan4687 3 жыл бұрын
Hello Zander, many thanks. Can you please share the link for the second part? I couldnt find it.
@veryacademy
@veryacademy 3 жыл бұрын
Not up yet
@bilalishaq23
@bilalishaq23 3 жыл бұрын
Good job!!!. Just curious to know how you getting autocomplete and help for the django built-in methods in vs code? Tried few things before but couldn't make it work
@veryacademy
@veryacademy 3 жыл бұрын
Hi, I will get that answered in the morning for you. I might do a quick guide tutorial, think that would be useful for others too that have asked 👍
@bilalishaq23
@bilalishaq23 3 жыл бұрын
@@veryacademy I'm really looking forward to havs your answer by morning, thanks
@MikeySalinas
@MikeySalinas Жыл бұрын
Dude you’re a legend
@ampereira
@ampereira Жыл бұрын
Congratulations for the best tutorial about Inline formset. How can I make a template and view to create a author and his books in the same page?
@veryacademy
@veryacademy Жыл бұрын
Thank you. To answer your question. It isn't something I can answer in detail here sorry.
@gealit
@gealit 2 жыл бұрын
Thanks for the explanation! Did you release next part? I'm struggling with querysets from foreign key fields) it would be cool if you show how to change queries to these fields, even using slug from url. Thanks!
@MrRahul15937
@MrRahul15937 3 жыл бұрын
Thanks sir, I am looking to start a project where I will use this video as a base/reference.
@7006608
@7006608 Ай бұрын
Great Tutorial and comprehensive!! Also there is a package called django-extra-views which simplifies Formsets, would be greate to create a video on that and compare it to the native method. btw, how do you incrementally show the progress of the code step by step ? is it done in post editing or live ?
@devnextbd
@devnextbd 3 жыл бұрын
Very Awesome tutorial for us.
@veryacademy
@veryacademy 3 жыл бұрын
Many many thanks
@millerdane
@millerdane 3 жыл бұрын
Thanks for sharing this. I like how you started with the basic and built up because persons who are new to django can get a good overview. Your tone and pace of delivery was excellent as well. What were you thinking about doing for the Example 2. I would like to suggest to have one template for entering the Author and the Book on one page. If find that this is a more common use case (example creating and Order with the Order Details in one go). If this can be shown with a Crispy Form then it would be just super...!!! Again thanks for the good work you have done in this example thus far. I will be looking at your other series/videos from here on in
@paborlouise319
@paborlouise319 3 жыл бұрын
Great, and challenging project.👍
@veryacademy
@veryacademy 3 жыл бұрын
Thank you! 👍
@atufashireen6238
@atufashireen6238 3 жыл бұрын
Really what i was ooking for...(but more than 2 models) also rendering in react
@veryacademy
@veryacademy 3 жыл бұрын
Excellent! I hope it is useful for you - 2nd part soon with more models. Noted about react.
@wisvem
@wisvem 2 жыл бұрын
You saved my life!
@veryacademy
@veryacademy 2 жыл бұрын
Thank you
@dodokwak
@dodokwak 3 жыл бұрын
Special thx for 1:03 and further.
@CoCo-yz6jh
@CoCo-yz6jh 3 жыл бұрын
Amazing tutorials sir! Thank you so much...you’re great 😊 No 1 teacher in the world! Keep up the great work 😊
@veryacademy
@veryacademy 3 жыл бұрын
Wow, thanks!
@supersecretninjame
@supersecretninjame 2 жыл бұрын
Can you explain "namespace" in the core.urls a bit more? I was not able to get it to work with the code you provided, but was able to make it work with a tuple inside the include method, then giving the path a namespace like this: include(("books.urls", "books"), namespace="books") why? and what exactly is namespace?
@IbrahimKMambo
@IbrahimKMambo 3 жыл бұрын
Great video! Thanks for the efforts. Btw, what extension do you use for django snippets?
@veryacademy
@veryacademy 3 жыл бұрын
github.com/vscode-django/vscode-django
@kerireme
@kerireme Жыл бұрын
First of all, thank you for your very interesting tutorial. Please how to use Inline Formsets to upload a csv file. It is to use a file containing the titles of the books for each author instead of adding these titles one by one. The book titles in the csv file should be saved in a posgres database and not mpas in a folder in the django application. Thank you so much.
@maheryagub
@maheryagub 2 жыл бұрын
Hello there, could you do an example with more >= 2 formsets.
@anilmanchanda6559
@anilmanchanda6559 3 жыл бұрын
nice presentation,very useful
@axelb.2006
@axelb.2006 3 жыл бұрын
Well done. Well explained and very usefull. Thanks for the job.
@necipmuzaffer6871
@necipmuzaffer6871 3 жыл бұрын
Hi Zander, great tutorial. Thank you. Is there a way to control the number of forms for adding new book inside the AuthorBookEditView ? You know there comes 3 forms by default.
@korneliuszziokowski5391
@korneliuszziokowski5391 3 жыл бұрын
Add, an attribute in: inlineformset_factory. extra=number of forms. It will look like this: AuthorBooksFormset = inlineformset_factory(Author, Book, fields=('title',), extra=3)
@TomislavMiletic
@TomislavMiletic Жыл бұрын
Do you maybe have a similar content but for FBV?
@veryacademy
@veryacademy Жыл бұрын
Sorry not at the moment.
@MrCamzu
@MrCamzu Жыл бұрын
Hello, could you tell me which theme are you use for Visual Studio Code in this video please ? Thank you :)
@quesoexistential
@quesoexistential 2 жыл бұрын
Hello, is there a way to do this but with 3 tables. Like, there is a level, section and subject model. List the level, then when you click a certain level, then it lists all the sections under that level, and then after clicking the level, you may be add/edit/delete subjects.
@veryacademy
@veryacademy 2 жыл бұрын
yes there is. 👍
@quesoexistential
@quesoexistential 2 жыл бұрын
@@veryacademy thanks for answering. I cant find any resources that help me pull it off. I watched the whole tutorial, do this and the thing im trying to do has the same logic? I just gotta do a list view of the levels then do detail view for the section? Is there any resource you can point out to me so i can get an idea to do it. Your help would be much appreciated
@joachimkre5682
@joachimkre5682 3 жыл бұрын
Bon tuto, puis-je avoir un exemple détaillé de django formtools combiné à un formset. J'ai déjà regardé la documentation. Merci
@fabioaugusto9360
@fabioaugusto9360 Ай бұрын
What is the VSCode's theme in this video?
@veryacademy
@veryacademy Ай бұрын
Owl
@drustan6890
@drustan6890 10 ай бұрын
Is there a way to do nested inlines???
@veryacademy
@veryacademy 10 ай бұрын
Of course sir, you need to decide if to build yourself or there are third-party packages like django-nested-inline or django-dynamic-formset that may provide more advanced features for handling nested inlines.
@leiayuri
@leiayuri 3 жыл бұрын
Sr. I am very thankful for what you have done. Such an EXCELLENT WELL SUPER job. Again Thanks MIL... Please Keep doing you are very clever man.
@veryacademy
@veryacademy 3 жыл бұрын
Thank you Yuri, I can make the second example when you and whoever else would like it. 👍
@leiayuri
@leiayuri 3 жыл бұрын
@@veryacademy i really appreciate it. For sure i would like to watch the next part. For now i will put those thing in practice and as soon as possible i will caught up you. Thanks again. 😊
@viniciusstucki
@viniciusstucki Жыл бұрын
Wonderful!!!
@veryacademy
@veryacademy Жыл бұрын
Many thanks!!
@muhammadsharif5526
@muhammadsharif5526 3 жыл бұрын
Hi Very academy excellent effort appreciated, however, I have a couple of questions if you can make them a separate tutorial or answer me in the comments, that are 1 How do we use atomic transactions? If any error occurred while saving a child's record, the parent record should also be rolled back and not saved. 2. In inlineformset_factory how do we load prefetch_related orselect_related 3 How do we display errors in inlineformset_factory Thanks for your time effort regards
@vivektiwari5474
@vivektiwari5474 3 жыл бұрын
you are greate sir, Thanks sir,
@veryacademy
@veryacademy 3 жыл бұрын
Most welcome
@ironheadmedia1625
@ironheadmedia1625 3 жыл бұрын
I am busy with Django on these days. I have just finished a beginner series and end of the serie the educator suggested your channel. I was just suprised. How could you go in that deep in Django ? There is no word to say for your skills of teaching and the way that you teach. You are great teacher and also great at Django :) Thank you for your all efforts. You have the most detailed Django series. I would like to know since when you have been working on Django ?
@veryacademy
@veryacademy 3 жыл бұрын
Hi C D, thank you. To be honest we have barely gone into any depth yet, as the channel grows I will go deeper. It is hard to say how long I have been using Django.
@tommyokai8547
@tommyokai8547 3 жыл бұрын
Hello, @VeryAcademy I have managed to create multiple inline formsets with foreignKeys. Everything saves fine except the ImageField this is the error The 'authorised_signatory1' attribute has no file associated with it. ...... During handling of the above exception ('ImageFieldFile' object is not subscriptable), another exception occurred: I don't want to post the whole TraceBack here Can you please help..... thank You
@ramiboutas
@ramiboutas 3 жыл бұрын
After watching this great video: I want to cry
@veryacademy
@veryacademy 3 жыл бұрын
That bad -sorry. There is an example 2 - I need to record it - its the next level inlines in inlines.
@vivektiwari5474
@vivektiwari5474 3 жыл бұрын
please sir make one video on python OpenCV in depth as soon as possible ,Thanks
@veryacademy
@veryacademy 3 жыл бұрын
Hi Vivek, definitely wont see seeing any OpenCV anytime soon sorry to say. Bit of blast from the past - I remember it being launched. I really wish I could produce everything quicker here - maybe at some point if things get a bit bigger around here I will have more time to expand into other Python adventures.
@LavYash
@LavYash 3 жыл бұрын
By far the best video on this topic. Thanks!! will wait for the part 2. However, I have a doubt.. In form_valid method of AuthorBooksEditView, if I wanted to save an additional field, say created_by_user(column of Book model); how would I achieve that? Since, form.instance. created_by_user = self.request.user isn't working and I think its because I'm passing a value for the parent class(Author) rather than the child class.. It will be a lifesaver if you could clarify that.
@veryacademy
@veryacademy 3 жыл бұрын
Hi Lav, you still need help with this?
@LavYash
@LavYash 3 жыл бұрын
@@veryacademy Yes, please. I've tried using the related name but to no avail. I must be making a mistake somewhere.
@atchutram9894
@atchutram9894 3 жыл бұрын
This is almost what I was looking for. But I want to create both the parent and children together. In this example, the author and books are all in one creation form.
@jorgetapia8219
@jorgetapia8219 Жыл бұрын
very good
@alexforget
@alexforget 2 жыл бұрын
Why do you use 'pk' instead of the usual 'id' in Django?
@chrisogonas
@chrisogonas 2 жыл бұрын
That was useful. Thanks
@ungeheurenungeziefer2662
@ungeheurenungeziefer2662 3 жыл бұрын
Is there any website on the whole internet where you have 3 forms like “add one more book”? Why noone explain how to create inline formset with dynamic option of adding forms?
@veryacademy
@veryacademy 3 жыл бұрын
If there isn’t I will make one!
@ungeheurenungeziefer2662
@ungeheurenungeziefer2662 3 жыл бұрын
I would be grateful! thank you for quick response!
@thiphan7023
@thiphan7023 2 жыл бұрын
Your videos are very helpful. Thanks, bro. Can you make some video to explain in more detail about get_context_data, get_object, and get_queryset?
@priyarathi4207
@priyarathi4207 3 жыл бұрын
When part four of the django e commerce series will come ?
@veryacademy
@veryacademy 3 жыл бұрын
Next ecommerce will be a big refactoring and follow up the loose ends in the code. Then....what would you like to see?
@CoCo-yz6jh
@CoCo-yz6jh 3 жыл бұрын
Do you have plan of teaching any other programming language in future like Java?
@veryacademy
@veryacademy 3 жыл бұрын
Sorry Java? I don't know that 😁 is that some sort of Tea?
@CoCo-yz6jh
@CoCo-yz6jh 3 жыл бұрын
Lol no sir I know you’re joking 🙃
@akhillshetty2140
@akhillshetty2140 3 жыл бұрын
When is part 2 coming out?
@veryacademy
@veryacademy 3 жыл бұрын
Like I said to the other guys - when you are ready I will make it!
@yousefiazkco1440
@yousefiazkco1440 Жыл бұрын
Thank you, boss
@Zhilinjain
@Zhilinjain Жыл бұрын
Better than paid courses in Udemy
@wazidmalik6824
@wazidmalik6824 2 жыл бұрын
Thankyou so much
@supersecretninjame
@supersecretninjame 2 жыл бұрын
where is example 2? :)
@alexbalak9594
@alexbalak9594 3 жыл бұрын
name 'messages' is not defined
@veryacademy
@veryacademy 3 жыл бұрын
Hi Alex, did you get this working?
@alexbalak9594
@alexbalak9594 3 жыл бұрын
@@veryacademy Yes thank you. I just have forgoten the import.....
@NicolasLopez-w7t
@NicolasLopez-w7t Жыл бұрын
I feel i wasted an hour just to setup a class based view
@MrSunTrope
@MrSunTrope 10 ай бұрын
Thank you so much
Django Dynamic Forms Tutorial with Htmx
48:27
Matt Freire
Рет қаралды 70 М.
人是不能做到吗?#火影忍者 #家人  #佐助
00:20
火影忍者一家
Рет қаралды 20 МЛН
Learn Django - Build an Asynchronous Chatroom with Django and Channels
1:31:27
Using the Inline Form Set Factory in Django (Part 1 of 2)
19:31
Pretty Printed
Рет қаралды 59 М.
Django To Do List App With User Registration & Login
2:12:03
Dennis Ivy
Рет қаралды 343 М.
Django 4.0 Crash Course | Build a Real Estate Website
2:07:49
Matt Freire
Рет қаралды 66 М.
Google’s Quantum Chip: Did We Just Tap Into Parallel Universes?
9:34
Django Tutorial for Beginners - Build Powerful Backends
1:02:36
Programming with Mosh
Рет қаралды 2,7 МЛН
Django and Stripe Payments Tutorial
1:10:27
Matt Freire
Рет қаралды 99 М.