Raid detail: Prefetch all required objects (e.g. response user's rank and main); 164 -> 31 queries.
This commit is contained in:
parent
7820021864
commit
57b3a28008
|
@ -88,7 +88,13 @@ class RaidDetailView(SingleObjectMixin, MultiModelFormView):
|
|||
|
||||
def get_queryset(self):
|
||||
return Raid.objects.prefetch_related(
|
||||
"responses", "responses__character", "comments", "comments__user__main"
|
||||
"responses",
|
||||
"responses__character",
|
||||
"responses__character__user",
|
||||
"responses__character__user__rank",
|
||||
"responses__character__user__main",
|
||||
"comments",
|
||||
"comments__user__main"
|
||||
).all()
|
||||
|
||||
def get_form_classes(self):
|
||||
|
|
Loading…
Reference in a new issue