- foreign key & one-to-one relationship
prefetch_related
- many-to-many and many-to-one relationshipMore info:
- generic foreign key & relationship
https://docs.djangoproject.com/en/dev/ref/models/querysets/#select-related
https://docs.djangoproject.com/en/dev/ref/models/querysets/#prefetch-related
what is the proper way to optimize the code using prefetch_related and select_related
ReplyDelete