prefetch_related list django
# Use the magic syntax with "*" to expand the list
Knight.objects.all().prefetch_related(*selected_attributes)
prefetch_related list django
# Use the magic syntax with "*" to expand the list
Knight.objects.all().prefetch_related(*selected_attributes)
django select_related and prefetch_related
django select_related and prefetch_related
select_related >> foreignkey
prefetch_related >> many to many
basically they are performance boosters ,used to avoid multiple unnecessary queries
Both methods achieve the same purpose, to forego unnecessary db queries.
But they use different approaches for efficiency..
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us