Django ORM - Querying and Creating Records / Working with Foreign Keys

แชร์
ฝัง
  • เผยแพร่เมื่อ 9 ม.ค. 2025

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

  • @bugbytes3923
    @bugbytes3923  9 หลายเดือนก่อน +2

    Playlist link: th-cam.com/video/EsBqIZmR2Uc/w-d-xo.html

  • @anouarbagent2511
    @anouarbagent2511 ปีที่แล้ว +22

    this is literally the best Django Channel there is, keep up the good work Lyle it will definitely get much bigger.

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

      Wow, thanks Anouar! Glad you like the content!

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

      I agree entirely ..

    • @anthonykarungu1419
      @anthonykarungu1419 8 หลายเดือนก่อน

      Totally agree. I really follow your content now.

  • @annyd3406
    @annyd3406 3 หลายเดือนก่อน +2

    One of the best tut i have watched while learning DJANGO , Thanks Mate.

    • @bugbytes3923
      @bugbytes3923  3 หลายเดือนก่อน +1

      Thanks a lot mate for the kind words! Glad you liked it.

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

    Thanks man! This video of yours just help me run a script to create some fake data for an app I am working on. Being a beginner when it comes to Python and Django, your work is very inspiring and easy to understand and follow along. Cheers

    • @bugbytes3923
      @bugbytes3923  29 วันที่ผ่านมา +1

      @@alvarofigueroa4693 glad to hear it helped man! Thanks for the nice words 🙏

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

    I don't get any channel regarding django orm since past few months but got an exciting series from heaven thank u❤❤❤❤

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

      Thank you so much, really appreciate the nice comment! 🙂

  • @BhaiyaJee
    @BhaiyaJee 2 หลายเดือนก่อน +4

    Why this man have only 31.6k Subs he deserves much more

    • @bugbytes3923
      @bugbytes3923  2 หลายเดือนก่อน

      Haha thanks, nice to hear that!

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

    showing sql was great, it gives idea of what queries is being executed, keep doing it.

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

    great. I don't think anybody explaining these things in django. most just touch the basic things. super helpful. just keep on doing.. . hope you also spend enough time on authentication and show custom user models in future.

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

      Thank you - glad it is helpful :)
      Will do!

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

    It's always good to have you here. Thanks very much for the insights you've been given.

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

    So simple, so easy to learn with you master 🙌🏾. Thank you.

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

      Thank you for the support Seydina! 😀

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

      Dj-Sensei 😁

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

      @@Davidkiania 😅

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

    Thank you so much for this tutorial and of course very interested in this content and please continue in this very format there's very little internet content on the same. Excellent stuff

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

      Thank you David - will do!

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

    ¡Gracias!

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

      Thanks so much!

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

    I haven't seen the video yet. But I am grateful that you are putting such videos out.

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

      Thank you - hope you like this video.

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

    Excellent video series so far. A bit fast but that keeps you focused. Not exactly for people with a moder super short attention span. Thank You so much for putting this together, learning a lot.

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

      Thank you! I'll take the suggestions on board, too! Thanks for watching.

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

    As always, great, high level, and detailed videos. Thank you so much.💪

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

    Please keep going with this series. Like from me on every single video here. This is amazing.

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

      Thanks a lot! Really happy the series has been useful - got around 15 more videos written up, so plenty more to come!

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

    another excellent video! Channel is probably the best for Django and related subjects.

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

    This is a great tutorial about querying the database with Django! 🙏😀👍
    I like that you show the under-the-hood SQL queries sometimes (and not too much).
    And as pprint alternative: the rich and django-rich libraries are great for pretty printing stuff to the terminal too.

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

      Thanks a lot Sil!
      I'll look into rich/django-rich - haven't used those tools yet.

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

      @@bugbytes3923 With rich I love that it requires zero code change as drop-in replacement 'from rich import print'. Done.

  • @gigi123-hp3
    @gigi123-hp3 หลายเดือนก่อน +1

    Very well explained..❤

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

      Cheers! Glad you thought so!

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

    Thanks Alot... You are my Django Mentor

  • @abdullahmosbah8410
    @abdullahmosbah8410 3 หลายเดือนก่อน +1

    the most useful course

    • @bugbytes3923
      @bugbytes3923  3 หลายเดือนก่อน

      @@abdullahmosbah8410 thanks a lot!

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

    Very Great content, Just keep doing the queries explanation and Thank you

  • @shamshad-live
    @shamshad-live ปีที่แล้ว +1

    Perfect explanation !

  • @امینجمالی-خ9ص
    @امینجمالی-خ9ص 4 หลายเดือนก่อน

    awesome explanations
    thank you

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

      Thanks a lot!

  • @Surajkumar-ok4ze
    @Surajkumar-ok4ze 8 หลายเดือนก่อน

    Awesome explanation

    • @bugbytes3923
      @bugbytes3923  8 หลายเดือนก่อน

      Thanks a lot!

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

    Awesome video 💪

  • @SOHAILKHAN-iu8fu
    @SOHAILKHAN-iu8fu ปีที่แล้ว +1

    Awesome video 💪 plz Also make video on django subquery

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

      Thank you! For sure, I'll do one on this later in this series.

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

    Thank you so much!

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

      Thanks for watching!

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

    Thank you, 3 lessons in and already better than paid udemy orm course, straight to the point without losing time on theory. Is there an option to pay something in order to suggest, and you maybe take into consideration to create a video on that subject?

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

      Hi Tomislav - thanks a lot for your support! You are free to suggest anything here, thank you! If you can support in any way (no obligation of course), there is also a ko-fi page:
      ko-fi.com/bugbytes
      Thanks again and glad you're enjoying the series! I have actually just this second finished recording the next video in this series - will be released this week.

  • @ammaryasser4839
    @ammaryasser4839 11 หลายเดือนก่อน

    Go on, if you make a complete course on Django for beginners it will be very useful and it will be a unique explanation

    • @bugbytes3923
      @bugbytes3923  11 หลายเดือนก่อน

      I'm looking forward to doing this at some point - just need to find the time!

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

    I see you’ve reviewed django-hijack. Have a look at Django-unfold too

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

    This made Django learning very simple.. I just had one doubt, in normal query even when you were doing all the sql query has limit 21, did you configure that somewhere or is it default or where is that coming from? Thanks again for videos.

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

    i think we shouldn't use get_or_create for user rating beacuse if user previously gave 5 star to a restaurant and now it's dissatisfied and want to give 2 stars then get_or_create will not be able to find the 5star rating of the user and will create another record in Ratings table with 2 star rating and it will lead to duplicates in rating unless user field is defined as unique
    thank you so much for your effort, great series

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

    Would love it if you would do a video on creating a multi-tenant Django app. For example a SaaS that allows for organizations with multiple related users.

  • @jedi2light
    @jedi2light 8 หลายเดือนก่อน

    Isn't it confusing that UPDATE statement on save() method call contains all the fields whereas we only changed `name` of the restaurant? 23:56
    Just in case if someone is wondering how to avoid it, we can pass `update_fields` to `save()` methods which a list of strings where each string is the name of the field we want to include in `UPDATE...` statement produced by Django ORM

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

    I'm definitely interested

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

    Thank you very much! 👍 Where would you put that logic? Do you use fat models?
    Btw. I'm interested in sql queries though I'm glad the ORM does the heavy lifting.

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

      Thanks!
      I put a lot of the logic in models usually. Or use a custom manager or queryset implementation - more on that later in this series!
      Generally, in a real app, I try to keep the views thin, with different techniques for doing so.

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

      @@bugbytes3923 Awesome, I can't wait to see that in action!

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

    Good thank

  • @amine63404
    @amine63404 10 หลายเดือนก่อน

    Great tutorial. I have a question please.
    When you have three tables as following :
    Restaurant
    Sale - fk restaurant
    Invoice - fk sale
    How do you get all invoices related to the restaurant ?
    Can we use something like
    Restaurant.sale_set.all().invoice_set.all()
    ???
    Thank you again for such a great tutorial.

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

    Wonderful

  • @Zzz-xt6ki
    @Zzz-xt6ki 9 หลายเดือนก่อน

    I am not getting suggestions like rating.object.create and rating.object.filter(). How to get those?

  • @pedarayududola1672
    @pedarayududola1672 8 หลายเดือนก่อน

    I'm getting the error ModuleNotFoundError: No module named 'django_extensionscore'

    • @bugbytes3923
      @bugbytes3923  8 หลายเดือนก่อน

      Make sure you have django-extensions installed (you can install with pip)
      It’s concatenating that with the “core” app - are you missing a comma between the two elements in INSTALLED_APPS?

  • @立法院很忙
    @立法院很忙 ปีที่แล้ว

    First!

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

    Find ❌ Feyind✅