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

แชร์
ฝัง
  • เผยแพร่เมื่อ 23 ส.ค. 2024

ความคิดเห็น • 117

  • @sbriscoe13
    @sbriscoe13 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.

  • @carewen3969
    @carewen3969 3 ปีที่แล้ว +5

    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 👍

  • @lauderday8
    @lauderday8 3 ปีที่แล้ว +9

    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 ปีที่แล้ว +2

      Thanks Lauder - hopefully it was useful, like I said to the others, I will expand on this shortly with 3 models.

  • @rasmusarvidsson2590
    @rasmusarvidsson2590 2 ปีที่แล้ว +2

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

  • @genericnamethingy
    @genericnamethingy 2 ปีที่แล้ว +1

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

  • @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!

  • @alexforget
    @alexforget ปีที่แล้ว

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

  • @sebastienlefloch3767
    @sebastienlefloch3767 ปีที่แล้ว +1

    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  ปีที่แล้ว +1

      I didn't make it after all that, sorry about that.

    • @sebastienlefloch3767
      @sebastienlefloch3767 ปีที่แล้ว +1

      Perhaps for a future video 🙏

    • @romanhrobot9347
      @romanhrobot9347 ปีที่แล้ว

      @@veryacademy Pretty please

  • @alejandroeliasdiazorellana257
    @alejandroeliasdiazorellana257 2 ปีที่แล้ว +1

    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,

  • @onyeibo
    @onyeibo 2 ปีที่แล้ว +1

    You are an excellent teacher😍😍

  • @MikeySalinas
    @MikeySalinas ปีที่แล้ว +1

    Dude you’re a legend

  • @atufashireen6238
    @atufashireen6238 3 ปีที่แล้ว +3

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

    • @veryacademy
      @veryacademy  3 ปีที่แล้ว +3

      Excellent! I hope it is useful for you - 2nd part soon with more models. Noted about react.

  • @rayt7338
    @rayt7338 2 ปีที่แล้ว +1

    TY we need more tutorials like yours.....

  • @jeancharlles9
    @jeancharlles9 2 ปีที่แล้ว

    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!

  • @marcdanon1419
    @marcdanon1419 3 ปีที่แล้ว +2

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

  • @CoCo-yz6jh
    @CoCo-yz6jh 3 ปีที่แล้ว +1

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

  • @michaelweintraub7461
    @michaelweintraub7461 2 ปีที่แล้ว

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

  • @wisvem
    @wisvem 2 ปีที่แล้ว +1

    You saved my life!

  • @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.

  • @tzur09
    @tzur09 ปีที่แล้ว +1

    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 !

  • @afaf6478
    @afaf6478 3 ปีที่แล้ว +1

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

    • @veryacademy
      @veryacademy  3 ปีที่แล้ว +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 ปีที่แล้ว +1

      @@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 🔥🔥🌍🌍

  • @MrRahul15937
    @MrRahul15937 3 ปีที่แล้ว +1

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

  • @leiayuri
    @leiayuri 3 ปีที่แล้ว +1

    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 ปีที่แล้ว +1

      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. 😊

  • @ryanthomas1609
    @ryanthomas1609 2 ปีที่แล้ว

    Very interesting and useful, eagerly waiting for the more challenging part 2

  • @dodokwak
    @dodokwak 2 ปีที่แล้ว

    Special thx for 1:03 and further.

  • @MrSunTrope
    @MrSunTrope 6 หลายเดือนก่อน +1

    Thank you so much

  • @paborlouise319
    @paborlouise319 3 ปีที่แล้ว +2

    Great, and challenging project.👍

  • @viniciusstucki
    @viniciusstucki ปีที่แล้ว +1

    Wonderful!!!

  • @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.

  • @atchutram9894
    @atchutram9894 2 ปีที่แล้ว

    Wonderful video. I want to watch your other Django tutorials now. Please make a video on Django MPTT if possible.

  • @atchutram9894
    @atchutram9894 2 ปีที่แล้ว

    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.

  • @programmingnothing
    @programmingnothing 3 ปีที่แล้ว +1

    Very Awesome tutorial for us.

  • @salmaahmed2171
    @salmaahmed2171 ปีที่แล้ว

    Well done, pal!
    Love it ❤️‍🔥

  • @jorgetapia8219
    @jorgetapia8219 ปีที่แล้ว +1

    very good

  • @axelb.2006
    @axelb.2006 2 ปีที่แล้ว

    Well done. Well explained and very usefull. Thanks for the job.

  • @Zhilinjain
    @Zhilinjain 9 หลายเดือนก่อน

    Better than paid courses in Udemy

  • @ramiboutas
    @ramiboutas 3 ปีที่แล้ว +2

    After watching this great video: I want to cry

    • @veryacademy
      @veryacademy  3 ปีที่แล้ว +2

      That bad -sorry. There is an example 2 - I need to record it - its the next level inlines in inlines.

  • @chrisogonas
    @chrisogonas 2 ปีที่แล้ว

    That was useful. 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

  • @rubendariohernandezcenteno5259
    @rubendariohernandezcenteno5259 2 ปีที่แล้ว +1

    How could I create an Author and add their Books in the same form?

  • @ampereira
    @ampereira ปีที่แล้ว +1

    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.

  • @anilmanchanda6559
    @anilmanchanda6559 2 ปีที่แล้ว

    nice presentation,very useful

  • @supersecretninjame
    @supersecretninjame ปีที่แล้ว

    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?

  • @vivektiwari5474
    @vivektiwari5474 3 ปีที่แล้ว +1

    you are greate sir, Thanks sir,

  • @abdelmajidalahyane3492
    @abdelmajidalahyane3492 ปีที่แล้ว +1

    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.

  • @wazidmalik6824
    @wazidmalik6824 ปีที่แล้ว +1

    Is example 2 is also available of this topic ?

  • @gealit
    @gealit ปีที่แล้ว

    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!

  • @maheryagub
    @maheryagub 2 ปีที่แล้ว

    Hello there, could you do an example with more >= 2 formsets.

  • @yousefiazkco1440
    @yousefiazkco1440 ปีที่แล้ว

    Thank you, boss

  • @wazidmalik6824
    @wazidmalik6824 ปีที่แล้ว

    Thankyou so much

  • @dimarcheosub
    @dimarcheosub 2 ปีที่แล้ว

    Thanks a lot for your tutorial and work. Very interesting, useful and clear! I spent a lot of hours on that argument and your video is the best one I have seen until now. In your video you mention that there will be another tutorial for those that need to manage more than one table with FK. Could you please tell me where I can find it ? Thanks in advance

  • @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

  • @MrCamzu
    @MrCamzu 9 หลายเดือนก่อน

    Hello, could you tell me which theme are you use for Visual Studio Code in this video please ?
    Thank you :)

  • @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?

  • @ungeheurenungeziefer2662
    @ungeheurenungeziefer2662 3 ปีที่แล้ว +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?

  • @IbrahimKMambo
    @IbrahimKMambo 3 ปีที่แล้ว +1

    Great video! Thanks for the efforts. Btw, what extension do you use for django snippets?

    • @veryacademy
      @veryacademy  3 ปีที่แล้ว +1

      github.com/vscode-django/vscode-django

  • @vivektiwari5474
    @vivektiwari5474 3 ปีที่แล้ว +1

    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.

  • @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

  • @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.

  • @yukselbastan4687
    @yukselbastan4687 3 ปีที่แล้ว +1

    Hello Zander, many thanks. Can you please share the link for the second part? I couldnt find it.

  • @alexforget
    @alexforget ปีที่แล้ว

    Why do you use 'pk' instead of the usual 'id' in Django?

  • @TomislavMiletic
    @TomislavMiletic ปีที่แล้ว +1

    Do you maybe have a similar content but for FBV?

    • @veryacademy
      @veryacademy  ปีที่แล้ว

      Sorry not at the moment.

  • @corsicana6868
    @corsicana6868 ปีที่แล้ว +1

    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  ปีที่แล้ว

      yes there is. 👍

    • @corsicana6868
      @corsicana6868 ปีที่แล้ว

      @@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

  • @drustan6890
    @drustan6890 6 หลายเดือนก่อน +1

    Is there a way to do nested inlines???

    • @veryacademy
      @veryacademy  6 หลายเดือนก่อน

      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.

  • @LavYash
    @LavYash 3 ปีที่แล้ว +1

    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.

  • @bilalishaq23
    @bilalishaq23 3 ปีที่แล้ว +1

    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 ปีที่แล้ว +1

      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

  • @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

  • @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)

  • @priyarathi4207
    @priyarathi4207 3 ปีที่แล้ว +1

    When part four of the django e commerce series will come ?

    • @veryacademy
      @veryacademy  3 ปีที่แล้ว +1

      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 ปีที่แล้ว +1

    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 ปีที่แล้ว +1

    When is part 2 coming out?

    • @veryacademy
      @veryacademy  3 ปีที่แล้ว

      Like I said to the other guys - when you are ready I will make it!

  • @supersecretninjame
    @supersecretninjame ปีที่แล้ว

    where is example 2? :)

  • @alexbalak9594
    @alexbalak9594 3 ปีที่แล้ว

    name 'messages' is not defined

    • @veryacademy
      @veryacademy  3 ปีที่แล้ว +1

      Hi Alex, did you get this working?

    • @alexbalak9594
      @alexbalak9594 3 ปีที่แล้ว

      @@veryacademy Yes thank you. I just have forgoten the import.....

  • @user-ed1yg5uz4t
    @user-ed1yg5uz4t ปีที่แล้ว

    I feel i wasted an hour just to setup a class based view