Understanding Django Model Relationships

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

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

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

    Join my free course on working with the database and models in Django: prettyprinted.com/djangodata

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

      sir you are really great, you are providing free Django course for all student

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

      You all probably dont care at all but does someone know of a tool to log back into an instagram account..?
      I was stupid forgot my password. I would appreciate any tricks you can offer me

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

      @Nicolas Leroy instablaster :)

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

      @Justus Jaxx I really appreciate your reply. I found the site on google and Im in the hacking process atm.
      Looks like it's gonna take a while so I will get back to you later with my results.

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

      @Justus Jaxx It did the trick and I actually got access to my account again. Im so happy:D
      Thank you so much you really help me out!

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

    Thank you for beautifully summarizing what would have been hours of research for me.

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

      You're welcome. I'm glad I could help

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

    It took my bootcamp teacher 90 minutes to explain what you just did in less than 30 minutes. He left me lost and confused, yet you made me understand everything so clearly. Thank you so much.

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

    The best explanation of model relationship i have ever seen on TH-cam , thanks for this awesome video

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

    I come back to this video from time to time, great content.

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

    Best explanation I've seen so far. Thanks very much. You deserve many more subscribers!

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

    You explain those so easy way

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

    Thank you for your clear explanation about models relationship

  • @mohamedabdi8377
    @mohamedabdi8377 5 ปีที่แล้ว +12

    the first youtube video with zero dislikes i have seen!

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

    Great explanation! Thank you.

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

    so clear and concise

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

    Dude, your videos are great. Thanks for the explanations.

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

    Thanks a lot sir, you nailed it....
    love you from India.

  • @justhored12
    @justhored12 5 ปีที่แล้ว +6

    Thank you so much! Keep doing what you do :)

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

      You're welcome! Thank you for watching.

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

    Very easy to understand explaination.

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

    First of all a big love from India ❤️. This is a awesome tutorial. I never thought I will get that kind of professional knowledge for free. I also join your free class. I really appreciate your hard work ❤️. Please make more videos on django

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

    easy , on the point , helpful video

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

    the 07:05 error was very educative !

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

    Thanks this is really helpful. I have been looking this type of video for long.

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

    Thank you for this video! Going through a django course right now and this was huge help! Nice to see quality django tutorials on here. Will be buying the course soon.

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

    This is really helpful, thanks.

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

    Very clear and helpful! Thanks a lot!!

    • @prettyprinted
      @prettyprinted  5 ปีที่แล้ว

      You're welcome! Thanks for watching.

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

    A very good explanation

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

    This is a great tutorial. Thanks a lot!

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

    Great tutorial on Django Model relationships! I read quite a few tutorials on this but did not really get it until I watched your video. THANK YOU! Liked and subscribed. I can't wait to watch the other videos you posted. (Thor for president!) =)

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

    This video was really helpful.. Thanks bro

    • @prettyprinted
      @prettyprinted  5 ปีที่แล้ว

      You're welcome! Thanks for watching.

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

    Great, easy to follow. Thanks alot!!

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

    Comment, like, subscribe, and the bell. Thank you very much for all your hard work. Appreciate it, man.

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

    Hey Anthony, great explanation and easy to understand, keep going with more stuff! Thanks ;-)

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

    Best explanation ever! Thank you.

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

    Perfect Tutorial 👍thanks alot!!

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

    Extremely useful, Thank you sooo much 💞

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

    Thank you very much. When concluding on one to many relationships you said you'll get into more about it in another video,which one?

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

    wonderful video thanks a lot

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

    Wao superb explanation ✌️

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

    Pretty nicely explained !

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

    Good explanation

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

    thanks for the great video

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

    The best video tutorial ever for django. Awesome explanation . I immediately joined your django tutorial course . Is any GitHub Repository available to refer the code available in this video ?

  • @LiaAdzumi
    @LiaAdzumi 5 ปีที่แล้ว

    Thanks for this great and helpful tutorials.

    • @prettyprinted
      @prettyprinted  5 ปีที่แล้ว

      You're welcome Thanks for watching.

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

    Thank you so much...🥺😇🙏🙏🙏

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

    Thank you 🙏🏼

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

    Amazing ♡♡♡ thank you so much

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

    Gold!!! Great work

  • @milandudhatra7484
    @milandudhatra7484 5 ปีที่แล้ว

    Thanks for the perfect video. you are great.

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

    Thank you

  • @renzyndrome
    @renzyndrome 5 ปีที่แล้ว

    clear and concise!

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

    Love you man!

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

    Thanks a lot

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

    so helpful

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

    great video! thanks

  • @YogeshKumarMurugesan
    @YogeshKumarMurugesan 5 ปีที่แล้ว

    Thanks for the tutorial 👍

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

      You're welcome! Thanks for watching.

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

    Thank u so much,you teach me the concept at once :}

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

    Great tutorial, thanks! could anyone tell me what shell it is he is using btw? looks nice

  • @hasan8267
    @hasan8267 5 ปีที่แล้ว

    very clear thank you

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

    That was awesome

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

    Thanks bruh

  • @aditt19
    @aditt19 5 ปีที่แล้ว

    You are awesome dude 👌👌❤️

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

    thanks !!!

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

    I could feel Corey Chafer intro

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

    great video

  • @buncha1499
    @buncha1499 5 ปีที่แล้ว

    This is awesome, thanks! :)

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

    Hi late to the party. I have a question, say I have 3 models, Country, State or Province and City or Town. Country ID if FK in Province/State. Should I have County and State PK as FK in City or just state FK and when I query a city I would be able to get all city, state and country details? If so, how can that be done?
    Thanks.

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

    In One-to-one relationship, we are getting only 1 attribute data. what we have to do to get all fields data?

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

    Dear sir please explain oneTOone field too. Please

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

    Why does the many-to-many table requires its own id? (Thx for the Video! :)

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

      Is it to add the same character multiple times to one movie? ... and vice versa?

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

    perfect!

  • @k.bharathreddy7238
    @k.bharathreddy7238 2 ปีที่แล้ว

    can i create an suggest friends notification api using model relationships

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

    sir can u please make a video on django channels real time chat app with rest api

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

    How do you clear the shell?

  • @DanielDaniel-hk9el
    @DanielDaniel-hk9el 4 ปีที่แล้ว

    About the example "Frameworks and Languages", how can i add a field on Languages and put the quantity of framework have the language?

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

      For that you will have to use the annotate and aggregate functions ....Anthony has done a separate video on this topic

  • @deadlock107
    @deadlock107 5 ปีที่แล้ว

    Awesome!

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

    hey what is the tool you are using for db visualisation

  • @deeraj3069
    @deeraj3069 5 ปีที่แล้ว

    awesome video....

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

    I thought you can only save without specifying a field by saying commit = false. But here we somehow do it without

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

    on ManyToMany example Django created charater_movieS table. Is it a convention for it to add S to the name? is there a way to kinda sort this out without looking into DB - for what is the name of the table? I mean yeh I could go terminal sqlite3 or other terminal for db and schema it up, but is there a simple way or scheme to find it out?

  • @Techie-time
    @Techie-time 5 ปีที่แล้ว

    Video is informative. However like any other video on this subject it indirectly assumes that the database structure started after Django was born. The fact is Data relationships or intricacies of databases are not the subject of django or any other framework. We need to look at this subject as ability of the framework to handle data relationship in a database.

  • @dhanunjaypaila4865
    @dhanunjaypaila4865 5 ปีที่แล้ว

    I have a requirement to load Excel data to postgres in django. I have created models and loading using pandas dataframe (to_sql). Buy I have a chally here in building relationships between models. As far as I know, we can build relationships if we save model objects one by one using (onetoone, foreign key,manytomany). Please help me how to create relationships when we upload Excel data in one shot

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

    How you got that response as tables for sqlite

  • @junartagulao6063
    @junartagulao6063 5 ปีที่แล้ว

    This is really helpful.. You are really great!!! I have a question, how will you apply that in "for loop" in the template using ForeignKey that will print the Language and also the associated Frameworks.. Thanks in advance :-)

    • @prettyprinted
      @prettyprinted  5 ปีที่แล้ว

      Each individual language will have an attribute called language_set. You can use that to get all the languages. So you'd have two loops in the template.

    • @24junar
      @24junar 5 ปีที่แล้ว

      Thank you so much for your time answering my question..Please make more django tutorials.. :-)

  • @atlaschooty
    @atlaschooty 5 ปีที่แล้ว

    Damm, amazing..

  • @MUZIXABA
    @MUZIXABA 5 ปีที่แล้ว

    The link to the Database Essentials course is returning a 404.

  • @ThePieas
    @ThePieas 5 ปีที่แล้ว

    Bro, can we query them using id ?
    For example. I have a table of movie and another table of actors.
    Python automatically gives an ID to a model.
    so can we query them with that id ??
    I tried this Actors.objects.filter(movie__id = 1) which failed
    Thanks In Advanced

    • @prettyprinted
      @prettyprinted  5 ปีที่แล้ว

      Yes, of course. What do you mean it fails?

    • @ThePieas
      @ThePieas 5 ปีที่แล้ว

      @@prettyprinted sorry, It is working now. I don't know what happened earlier.
      You are an awesome teacher. Currently watching the free django course on prettyprinted.com .. after finishing this i will buy the full course.

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

      @@ThePieas Awesome. I look forward to seeing you in the course.

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

    It would be nice if you use better zoom.In spite of that, ok!:)

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

    perfect... and thanku

  • @tamirtsogbayar3912
    @tamirtsogbayar3912 5 ปีที่แล้ว

    Hello thanks for all lesson
    i try ot making recruiting website but i have some problem
    i have 3 models
    general, education, experience
    general has his last name first name address phone ect
    education has his school information and general id
    also experience has his work experience information and general id
    problem is how to insert all data same time and get and insert general id pls help me

    • @prettyprinted
      @prettyprinted  5 ปีที่แล้ว

      You insert backwards from the child to the parent. So create the child first, save it to get the ID, and then add to parent.

  • @kyojindev3978
    @kyojindev3978 5 ปีที่แล้ว

    thx for video. but it`s so trivial. i think to illustrate ManyToMany example.
    is to use self-relation.
    class FacebookProfile(models.Model):
    .......
    friend_relationship = models.ManyToManyField("self")
    many people didn't know about this.

    • @prettyprinted
      @prettyprinted  5 ปีที่แล้ว

      I'll consider making a video on self relationships. Thanks for the idea.

  • @vamshinoora7914
    @vamshinoora7914 5 ปีที่แล้ว

    just need that in gui

  • @Ali-kx7jf
    @Ali-kx7jf 3 ปีที่แล้ว

    #_BEST_EVER_

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

    This guy is true fan of captain america

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

    +

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

    First you say "language='python' no i can't do that"... 30 sec later you created bottle just like this...

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

    Well-explained, thank you for this!

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

    Thank you!