47 - Model Managers & Custom QuerySets for Search - Python & Django 3.2 Tutorial Series

Поделиться
HTML-код
  • Опубликовано: 30 ноя 2024

Комментарии • 10

  • @ashir3730
    @ashir3730 2 года назад +5

    I never ever thought that search query could be this much robust. This is really insane believe me. Sir, You really worked hard for Django.

  • @eagleofsharm
    @eagleofsharm 2 года назад +1

    Every time I think of a comment to put here for Justin, nothing comes to my mind first except 'QUALITY', well done Bro, We love you { from Egypt }.

  • @maamounhajnajeeb209
    @maamounhajnajeeb209 Год назад

    What a great work on this course content, bravo

  • @alexurassa4857
    @alexurassa4857 2 года назад +1

    Love your explanations bro!!, you really make it easy to understand for me.

  • @batman_1337
    @batman_1337 4 месяца назад

    For reference search method: Mode.objects.search() is not something which is available by default in django, hence this is a new custom queryset method we are creating from zero. To create this we can do either:
    1. custom Manager
    2. Custom QuerySet
    Only difference is how they are linked to the model:
    1. objects = ArticleCustomManager()
    2. objects = ArticleCustomQuerySet.as_manager()
    FYI: objects is the default name that we used: remember Article.objects.

  • @second1799
    @second1799 3 месяца назад

    I see, so this overriding objects like overriding save method.

  • @IshwarJangid
    @IshwarJangid 2 года назад

    Hey Justin
    Please use dark mode in browser as well. Please

  • @techfinpro
    @techfinpro 2 года назад

    i think it is unnecessary implementing that complex queryset for searching a simple title or content in a blog.
    you make a lot of functions for handling the same data. I (personally) think it is not optimus way to program a search function.
    Please correct me if i am wrong.

    • @Krizas75
      @Krizas75 Год назад

      If You use same search pattern in another view (for example) You repeat all this one on more time. It is not optimal (not DRY). In real project 100% probability.
      Here we sow more way to solve same problem. You make Yours choice in yours code.

  • @russomario
    @russomario 2 года назад

    At 4:20 line 15. In witch cases the query is None and in which cases the query is an empty string?