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.
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?
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
This is a great series. It's great to slow down and focus on one aspect of Django.
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.
Use have solved my biggest problem of working with database in django. Please Make Videos on other methods(like select_related,exclude) also.
thanks very much for this series
Can we see a video on select_related and prefetch_related.?
Noted. Thank you!
this is great thank you
You're very welcome!
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?
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
Why does the select statement in 7:10 still contains all the fields even though only() is used?
students = Student.objects.filter(class_room=2).only('first_name') also gives last name as well.