Created
May 6, 2019 05:14
-
-
Save KimSoungRyoul/f56e414a0fc93ebbcf34dc422a8afba3 to your computer and use it in GitHub Desktop.
queryset 기본 구조
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(Model.objects | |
.filter(조건절) | |
.select_related('정방향_참조_필드') # 해당 필드를 join해서 가져온다. | |
.prefetch_related('역방향_참조_필드') # 해당 필드는 추가쿼리로 가져온다. | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment