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

preview_player
Показать описание
A Python Django Inline Formset example tutorial using Class-based views and inline formsets. In this example we use TemplateView, ListView, CreateView, DetailView, FormView,
SingleObjectMixin, FormView overrides get/post/get_form to build a work example whereby with Inline Formsets work with 2 models data to update, delete, save from a single form.

00:00 Introduction
01:13 Build preview
03:23 Learning about Inline Formsets
Step-0
06:27 Setup project folder and venv
07:41 Create new project
07:48 Create a new project
08:17 Add project to settings
08:32 Project models
Step-1
12:56 Build homepage URL
15:49 Homepage (TemplateView)
17:31 Building Home/Base templates
Step-2
23:23 Building authors list page URL
25:04 Authors list view (ListView)
27:10 Authors list template
30:40 Superuser and add models to admin
Step-3
36:05 Create new authors URL
36:50 Create new author class (CreateView)
43:32 Create author template
Step-4
48:11 Show author detail URL
49:53 Show author view (DetailView)
52:57 Show author template
Step-5 (Working with Inlines)
01:01:22 Edit/Update/Delete/Save author books URL
01:03:10 Creating the view (SingleObjectMixin, FormView)
01:23:06 Building the form (inlineforset_factory)
01:31:25 Building the template

Final Code Example:

✨ Support us - join us as a very academy member

👍SUBSCRIBE to get more free tutorials, courses and code snippets!

👍👍Follow us on Facebook

👍👍👍Follow use on Twitter:
Рекомендации по теме
Комментарии
Автор

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 I am forever in your debt.

sbriscoe
Автор

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!

lauderday
Автор

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.

carewen
Автор

Just watched almost the whole class based views series. Thank you so much for creating it!! Amazingly good!

rasmusarvidsson
Автор

You have no idea how many things this cleared up for me. Thank you!

genericnamethingy
Автор

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!

kamilr.
Автор

Thank you, I learn so many new tricks by watching you.
That will reduce the amount of code I need for my projects.

alexforget
Автор

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,

alejandroeliasdiazorellana
Автор

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.

sebastienlefloch
Автор

Really what i was ooking for...(but more than 2 models) also rendering in react

atufashireen
Автор

Thank you for creating this video. It was helpful. You have good pacing and kept the material interesting.

michaelweintraub
Автор

Woohoo! I am so excited about this video!!!!

afaf
Автор

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!

jeancharlles
Автор

Great video and just what I needed for my current project. I look forward to the next tutorial with the additional model added in.

tonnjeremiah
Автор

First time I comment a Youtube 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

marcdanon
Автор

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 !

LeetCodeMastery-yd
Автор

Amazing tutorials sir! Thank you so much...you’re great 😊 No 1 teacher in the world! Keep up the great work 😊

CoCo-yzjh
Автор

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 ?

Автор

Thanks sir,
I am looking to start a project where I will use this video as a base/reference.

MrRahul
Автор

Thank you so much for this tutorial.
Is there a way to costumize the same form but inside the admin panel ?

abdelmajidalahyane
welcome to shbcf.ru