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
Yes, a large search is done. Through the LogAccessMixin Mixin, the get_object method is called in the render_to_response method. I noticed that this causes duplicate calls in the database, that is, the get_object method has already been called previously.
The number of calls made to the bank with Mixin
Now I remove the Mixin and implement the render_to_response method in a similar way but fetching the value of self.object first.
In a DetailView I configure the queryset directly in the class, like this:
Yes, a large search is done. Through the
LogAccessMixin
Mixin, theget_object
method is called in therender_to_response
method. I noticed that this causes duplicate calls in the database, that is, theget_object
method has already been called previously.The number of calls made to the bank with Mixin
Now I remove the Mixin and implement the
render_to_response
method in a similar way but fetching the value ofself.object
first.result:
I know the numbers are low, but on a larger scale it will be possible to avoid large numbers of consultations.
The text was updated successfully, but these errors were encountered: