You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@charettes raised a great idea where the toolbar could highlight where and how a developer could resolve an N+1 error.
For example, if the admin is setup to generate an N+1 error, we would direct them to either add the relationship(s) to list_select_related or to override get_queryset() to add a call to prefetch_related.
There may be a way to also provide this for the generic class based views as well (ListModelMixin), etc. It'd be neat to do this for DRF ViewSets/Views.
This could be difficult when the view has overriden get_queryset a few times and knowing which one should be modified. Though perhaps we start with the last defined method and point the user to that.
The text was updated successfully, but these errors were encountered:
@charettes raised a great idea where the toolbar could highlight where and how a developer could resolve an N+1 error.
For example, if the admin is setup to generate an N+1 error, we would direct them to either add the relationship(s) to
list_select_related
or to overrideget_queryset()
to add a call toprefetch_related
.There may be a way to also provide this for the generic class based views as well (ListModelMixin), etc. It'd be neat to do this for DRF ViewSets/Views.
This could be difficult when the view has overriden get_queryset a few times and knowing which one should be modified. Though perhaps we start with the last defined method and point the user to that.
The text was updated successfully, but these errors were encountered: