Issue
In the real world, how often do people use QuerySet methods like defer()
and only()
?
I guess I handnt really heard much about them and only recently have I came across these methods.
See Docs here. https://docs.djangoproject.com/en/dev/ref/models/querysets/
Solution
These methods are mostly of use when optimizing performance of your application.
Generally speaking, if you are not having performance problems, you don't need to optimize. And if you don't need to optimize, you don't need these functions. This is a case with a lot of advanced QuerySet
features, such as select_related
or prefetch_related
.
As for "how often they are used in the real world", that isn't really an answerable question. They are used when they're needed. If you don't need them, don't use them.
Answered By - Andrew Gorcester
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.