Database Relationships | One To Many & Many to Many | Django (3.0) Crash Course Tutorials (pt 6)

แชร์
ฝัง
  • เผยแพร่เมื่อ 2 ธ.ค. 2019
  • Checkout my new Django Course!
    dennisivy.teachable.com/p/dja...
    Introduction to Database model relationships. In this video we will be covering "One to Many" and "Many to Many" relationships and how this is implemented in Django.
    Follow me on Twitter: / dennisivy11
    Linkedin: / dennis-ivanov
    Source code: github.com/divanov11/crash-co...

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

  • @apingsample4720
    @apingsample4720 4 ปีที่แล้ว +18

    Your Visual representation of the relationship help us understand clearly, how i wish there are somethings like this in the Django documentation, it make things very easy! Thanks Dennis!

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

    I'm italian and i already watch 2 courses in italian language. But just now with your course i start understand better django! You're really the best... thanks for all!

  • @rafatulalam8677
    @rafatulalam8677 4 ปีที่แล้ว +9

    Really good content Dennis. Can you make a future mini series on understanding model relationships in Django and at the same time explaining the concept of making good ER diagrams for any website project. There are not many videos out there covering these concepts
    in depth and you explain extremely well. It would be really helpful if you would consider making a series like that in the near future

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

    i never really understood the intermediary table in the ManyToMany relationship until now, Thanks a lot for giving such a clear and easy to understand explanation!

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

    Best Django series I have ever seen 😍🔥super easy to understand💯

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

    Dennis, you make the best videos on Django. I am an engineer from South Africa. You are the most relatable coding youtuber to me. Keep making great content. It helps more than you know!!!

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

    I took many tutorials before this tutorial I have never seen like this one thanks million times dennis ivy

  • @ronanamelin
    @ronanamelin 4 ปีที่แล้ว +4

    The principle was explained much better then most tutorials that are floating around. It`s structured and reproducible. +1 to your channel! Cheers!

    • @DennisIvy
      @DennisIvy  4 ปีที่แล้ว

      I appreciate that Georgi :)

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

    many thanks to Dennis!! this channel is really beginner friendly

  • @LetCode96666
    @LetCode96666 4 ปีที่แล้ว

    Some tutorials are goo, some are so good and well explained which is also easy to follow and then comes your videos! Perfect tutorials to learn from! Thanks a lot

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

    I finished an entire udemy course and made two project tutorials on it but I didn't understand this concept until this video and project. Thanks mate!

  • @elmurodtadjibayev3212
    @elmurodtadjibayev3212 4 ปีที่แล้ว

    Greatest videos about Django I've ever seen. Super Dennis.

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

    Loud and clear, thanks mate !

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

    I did relational database for quite some time. Glad you corrected that Tags should be on Product and not on Order. It bothered me but I kept watching anyway cos I'm clueless with Django. Great series!

  • @matthieuo39
    @matthieuo39 4 ปีที่แล้ว

    Everything in this tutorial is awesome ! Your explanations are very good too. Thank you

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

    Thanks!
    Your free explanations are the best.
    Keep it like this

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

    Dennis, thank you for this useful tutorial! Easy to follow, well done!

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

    You've put in lot of hard work on this
    Appreciation from India

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

    Thanks for this content man. The quality is awesome

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

    It's just awesome...
    I referred a lot videos for django. .but your series is awesome..no comparison 🙇🙇🙇🙇

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

    please keep uploading awesome videos with great concept. thank you

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

    You are the best Teacher. Thanks for creating such videos.

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

    I just watched this and am amazed. Thanks

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

    I'm half way, but just need to say that this tutorial is way to great to be free... Premium content, without question!

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

    Excellent Explanations ! The first thing I do before watching your video is to like it ❤

    • @DennisIvy
      @DennisIvy  4 ปีที่แล้ว

      Haha really appreciate the support! Glad these videos are so helpful :)

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

    I really appriciate your content. I have been stuck in this for a long time. Thanks Again✌️

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

    Thanks a ton man, you made it so simple to understand

  • @parthjani8301
    @parthjani8301 4 ปีที่แล้ว +35

    excellent explanations, keep uploading, love from India

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

    Very good tutorial. Certainly deserves more subscribers and likes.

  • @theanonymous5268
    @theanonymous5268 7 หลายเดือนก่อน

    Great Video Thnx a lot
    for those who are super confused in the relations and then the code for relationships; I recommend watching this video again(and again) till your minds actually recognizes the pattern( you may take a break if you don't get it)
    BEST OF LUCK

  • @JEBJOSH
    @JEBJOSH 4 ปีที่แล้ว

    really helpful. The diagrams u draw and how you explain are rally helpful. thank you

    • @DennisIvy
      @DennisIvy  4 ปีที่แล้ว

      I'm really glad those helped! I thought it might be distracting putting them in there so I'm glad they are working :)

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

    Wow, great teacher!

  • @rangabharath4253
    @rangabharath4253 4 ปีที่แล้ว

    Awesome as always bro

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

    Hi Dennis, I love your way of Explanation. could you please also do a video about how to add foreignkey relationship in modelforms and render both in single template? Where foreignkey value can be choosen automatically while filling the form

  • @TheShadyStudios
    @TheShadyStudios 4 ปีที่แล้ว

    You're a great teacher bro

  • @stevesamah4018
    @stevesamah4018 4 ปีที่แล้ว +20

    This is super helpful I'm going to subscribe just because of this video.

    • @DennisIvy
      @DennisIvy  4 ปีที่แล้ว +8

      So glad you found it helpful! I didn’t know if the drawings would make it more confusing but they seem to be helping :)

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

      @@DennisIvy drawing did help us infact i understood that before building a long project, make a diagram .Thank you loving the course:-)

    • @akashpushkar306
      @akashpushkar306 4 ปีที่แล้ว

      @@DennisIvy First of all, thanks for such amazing lectures you are taking.
      How can I load data in my UI and apply slicers/filters on the data from .csv files in the dashboard. Secondly, how can I take user input on the dashboard and run an ML model in the background and refresh the dashboard. Any link for tutorials would be really great.

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

      This guy is now my go-to expect on most topics in Django. Dennis Ivy += 1 sub.

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

    Great explanation! Thank you!

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

    Thanks! Hello from Kazakhstan!

  • @CircuitNotion
    @CircuitNotion 22 วันที่ผ่านมา

    very helpful bro!

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

    Awesome!

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

    Hey Dude, Thanks for the video. Its helping me spin my own Ticketing System with DRF and PSU! 20$/mo back into my business's pocket!

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

    keep going amazing video sir thanks alot from somalia

  • @aashayamballi
    @aashayamballi 4 ปีที่แล้ว

    That was clear, thank you 😊😊

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

    five times i saw it is awesome

  • @mateuszmrowiec4265
    @mateuszmrowiec4265 4 ปีที่แล้ว

    Great tutorial! Thanks!

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

    From Morocco cheers mate.

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

    Thank you Denis God bless you

  • @ashrafulfuad2967
    @ashrafulfuad2967 4 ปีที่แล้ว

    thank you sir really great explanation with good example

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

    Great explanations man. I've seen your in CodingPhase but never visited your channel. Now I'm a subscriber eheh.

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

    感谢您的教程,对我的学习很有帮助!

  • @johnherrera5913
    @johnherrera5913 4 ปีที่แล้ว

    Great teacher!! thank you

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

    Great video coming from FastAPI where you need to be doing more sql than python sometimes I am very surprised how simple the relations are in Django. It’s really cool.

  • @Magistrado1914
    @Magistrado1914 4 ปีที่แล้ว

    Excellent course
    11/07/2020

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

    Thanks Dennis, you saved me £30,000 from University. I really appreciated.

  • @rajeshkumarsivaprakasam2159
    @rajeshkumarsivaprakasam2159 4 ปีที่แล้ว

    Super sir

  • @basheerbasheer2158
    @basheerbasheer2158 4 ปีที่แล้ว

    You are Amazing Man

    • @DennisIvy
      @DennisIvy  4 ปีที่แล้ว

      Thank you :)

  • @vineetsharma4121
    @vineetsharma4121 4 ปีที่แล้ว

    Your videos are damn good; among the best I have watched on so many other youtube channels. Can you make videos on NodeJS and React Native as well?

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

    @Dennis Ivy: First of all, thanks for such amazing lectures you are taking.
    How can I load data in my UI and apply slicers/filters on the data from .csv files in the dashboard. Secondly, how can I take user input on the dashboard and run an ML model in the background and refresh the dashboard. Any link for tutorials would be really great.

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

    Denis Ivy , at 11:06, you mention changing the tags selection to a multi-select checkbox. I can't find where you do that in this video, or the next. Where/how do you change that? Also how could I change a dropdown option to radio buttons. BTW, thank you for awesome content!

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

    thank you

  • @nisithmondal7026
    @nisithmondal7026 4 ปีที่แล้ว

    very helpful Contents

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

    thank you a lot

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

    damn bro u are the best

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

    It's very good

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

    I love this playlist and you really great at explaining the basics too!
    I had one question how does Django only ask for customer name specifically in order model like it access name column only what if we want to access another column from customer in order model?

  • @STU0408
    @STU0408 4 หลายเดือนก่อน

    Thanks for the video. Very helpful! Does anybody know why the multiselect option is provided only on one side of the model in the admin panel if Many-To-Many is used? Theoretically it should be shown on both sides.

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

    Boss of the Bosses

  • @KevinTempelx
    @KevinTempelx 4 ปีที่แล้ว

    ty

  • @kalenzo78
    @kalenzo78 4 ปีที่แล้ว

    Iam kind of taken up by javascript iisssh but I will catch up with series keep up the nice work bro

    • @DennisIvy
      @DennisIvy  4 ปีที่แล้ว

      JavaScript is a blast! Enhances your capabilities with Django a tone too. Thanks for your constant support :)

  • @devarakondaavinash10
    @devarakondaavinash10 4 ปีที่แล้ว

    Hi Dennis kindly make more interesting projects on Django

  • @devngecu
    @devngecu 4 ปีที่แล้ว

    This may not be quite clear but i hope you understand:
    I have created my class models with the relationships addressed in this video.But every class requires the foreign key class to be predefined above it,making the whole process an infinite loop.How do i tackle this?

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

    Dennis, Do we use django database in production env or we use, database like Mysql in three tier arch with separate server. Can you say what is difference between in build django database and database servers

  • @k.m.jiaulislamjibon1443
    @k.m.jiaulislamjibon1443 3 ปีที่แล้ว

    @Dennis Ivy.... Thanks for your journey of videos . It helping a lot. One more thing here you are adding selecting the Customer manually cause you are admin. But suppose when a customer orders a thing then in the order form can you plz show me way to select the user automatically to "Current User" where i have choices of users. thanks

  • @VijayKumar-dq3ph
    @VijayKumar-dq3ph 2 ปีที่แล้ว

    Hi , do you have video explaining foreign key relations among tables of different databases or any hint on how to achieve that?

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

    Can you please explain how to join tables (inner join) the joining tables has no foreign key relationships in django orm and once join is happen how to serialize the data to create API?

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

    Hey I understand the concept of many to many and one to many, the way you implement it I also do the same but I am unable to understand how many to many relationship data will we stored because we have not created any intermediate table and also I am unable to find it in my database.

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

    Can you do a follow up tutorial to this video explaining how to create a Model Form from the Order model?

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

    Good morning , please is it possible to implement this many to many relationship and one to many relationship using mysql as my database

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

    Instead of have choices via a dropdown, is it possible to have checkboxes and allow multiple options to be chosen?

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

    manytomany field is used when we need to connect an object with many objects of another table,
    Product can have multiple Tag like
    ice cream is product and summer,food are Tags.

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

    How should I make more user friendly to many to many field in admin panel? TabularInline is not good when too many values in many to many field.What should I use?

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

    i had a doubt. can the orders be entered via the form given to the user too?
    instead of manually entering them in the db

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

    Thanks for the excellent content. Though on 2:00 I think one product (ball) can have both Sports Tag and Summer Tag but then BBQ Grill can't have summer as a tag. It is one to many not one to one. Am I right?

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

    Please upload one video daily. spread the knowledge. thank you

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

      Uploading two right now :) had to reshoot yesterday’s because I didn’t like the way it turned out.

    • @rayganmudberry375
      @rayganmudberry375 4 ปีที่แล้ว

      @@DennisIvy thank you.

  • @vishalmishra1937
    @vishalmishra1937 4 ปีที่แล้ว

    i am implementing QA forum in which i have a doubt suppose user ask a question and that question can be associated with many tags then how to implement its db design.please help@dennis Ivy

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

    I tried to form a primary key that would contain two fields. If I understood right the info I found from web, Django does not support such feature and it has been so for a long time. What could be so difficult/overwhelming to prevent to implement a common feature like that?

  • @aavlasti
    @aavlasti 4 ปีที่แล้ว

    The course is really great, but I have a question. Why we put the Tags class above the Product class? We can not just write it anywhere and access it? I mean why we need to have the order(not the Order class) in the code file? Is it just a preference from you? or it will not work otherwise?

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

    When did you load the models.py? Not in this course, should we imported into this course from another?

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

    Suggestion: press F7 and DOS window will display all the commands you entered previously

  • @matiasezequiel9559
    @matiasezequiel9559 4 ปีที่แล้ว

    Thanks for this awesome series! I've saw your update using inline forms to add multiple order at the same time. But, Is it possible to add multiple porducts at the same order? How would you make the models for that? Can't figure out the best aproach to acomplish that.
    Thank in advance.

    • @anuragk6722
      @anuragk6722 4 ปีที่แล้ว

      use to many to many relationship.Basically each order can have index of one or more product

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

    @12:15 Wait a minute, we don't have to makemigrations & migrate after changing the codes in models.py?

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

    why to create a new customer user name and email? how can I directly import already existing users from table and display on page model customers!

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

    soooo good.... nice. so if the Customer just cancel a ORDER that he or she made. the Order still on are database, as a Canceled ordered status, right??? sorry for my ENGLISH. but great Job.

  • @rolandogarciacutie5676
    @rolandogarciacutie5676 4 ปีที่แล้ว

    Hello Dennis,i migrate my datebase to a postgres database and when i try to agregate a product it show me a error name error de sintaxis en o cerca de ON

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

    Hey can anyone help? I'm creating a project similar to his. But instead of tags, I'm adding products to my order. which I can get working like he has but I want to add a quantity options as well. Is this possible??

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

    I'm confused as to why you had to run migrate at 8:44 but not at 12:11, even though you made a change to the models.py file?

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

    Dennis at 11:11 you mention that you would be change the ManyToManyField to a checkbox in the admin. Did you ever get to that?

  • @6ftofmisery636
    @6ftofmisery636 4 ปีที่แล้ว +2

    Hey Dennis, I understand the logic behind one to many relationship for the customer but what if we have a large number of customers? don't you think a drop down feature would be slightly awkward?

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

      that's just the default representations from admin-django if u want to search and get more out of field I thnk using the database in more helpful

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

    @Dennis why i get error while opening source code ..error like this
    Application error
    An error occurred in the application and your page could not be served. If you are the application owner, check your logs for details. You can do this from the Heroku CLI with the command
    heroku logs --tail

  • @ahmadjuuko352
    @ahmadjuuko352 4 ปีที่แล้ว

    Very impressive explanation. But why don't you use cascade on delete so that the order made by a certain customer is also deleted when he is deleted to avoid orphaned entries