Query optimisation on attendee_data form
This commit is contained in:
parent
7058260e5c
commit
ffe5194893
2 changed files with 2 additions and 2 deletions
|
@ -24,7 +24,7 @@ class DiscountForm(forms.Form):
|
|||
|
||||
class ProductAndCategoryForm(forms.Form):
|
||||
product = forms.ModelMultipleChoiceField(
|
||||
queryset=inventory.Product.objects.all(),
|
||||
queryset=inventory.Product.objects.select_related("category"),
|
||||
required=False,
|
||||
)
|
||||
category = forms.ModelMultipleChoiceField(
|
||||
|
|
|
@ -543,7 +543,7 @@ def attendee_data(request, form, user_id=None):
|
|||
).exclude(
|
||||
cart__status=commerce.Cart.STATUS_RELEASED
|
||||
).select_related(
|
||||
"cart", "product"
|
||||
"cart", "cart__user", "product", "product__category",
|
||||
).order_by("cart__status")
|
||||
|
||||
# Get all of the relevant attendee profiles in one hit.
|
||||
|
|
Loading…
Reference in a new issue