Django ORM - Select and Output individual fields example

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

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

  • @julienboudreau8419
    @julienboudreau8419 3 года назад +2

    This is a great series. It's great to slow down and focus on one aspect of Django.

    • @veryacademy
      @veryacademy  3 года назад +1

      Thanks Julien, this is something that is really missing on a lot of topics. People tend to go for projects and not spend time getting to know the detail.

  • @nucleusnode23
    @nucleusnode23 3 года назад

    Use have solved my biggest problem of working with database in django. Please Make Videos on other methods(like select_related,exclude) also.

  • @coskundeniz7656
    @coskundeniz7656 3 года назад

    thanks very much for this series

  • @bringinglife2
    @bringinglife2 4 года назад +3

    Can we see a video on select_related and prefetch_related.?

  • @taddelepetros8106
    @taddelepetros8106 3 года назад +1

    this is great thank you

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

    It is interesting. If I select only the firstname and the age it is also possible to display the surename and the classroom. The SQL querie ('sql': 'SELECT "student_student"."id", "student_student"."firstname", "student_student"."age" FROM "student_student" WHERE "student_student"."classroom" = 1)
    calls only the firstname and age but its seems to take the whole instance ...
    So what does the ".only()" do?

  • @ZZ-vz9in
    @ZZ-vz9in Год назад

    How can I sort the posts of one user, for example, I only want to display the posts of a user who uploaded them on his own account, like the technology in Facebook, that is, when I upload a post, I can see it on my own page, I want to do something similar to that But I haven't succeeded yet

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

    Why does the select statement in 7:10 still contains all the fields even though only() is used?

  • @mr.anderson5393
    @mr.anderson5393 2 года назад

    students = Student.objects.filter(class_room=2).only('first_name') also gives last name as well.