mirror of
https://github.com/pretix/pretix.git
synced 2026-05-05 15:14:04 +00:00
Remove redundant query to event table
This commit is contained in:
@@ -32,7 +32,9 @@ def get_grouped_items(event):
|
||||
).select_related(
|
||||
'category', # for re-grouping
|
||||
).prefetch_related(
|
||||
'quotas', 'variations__quotas', 'quotas__event', # for .availability()
|
||||
'variations__quotas', # for .availability()
|
||||
Prefetch('quotas',
|
||||
queryset=event.quotas.all()),
|
||||
Prefetch('variations', to_attr='available_variations',
|
||||
queryset=ItemVariation.objects.filter(active=True, quotas__isnull=False).distinct()),
|
||||
).annotate(
|
||||
|
||||
Reference in New Issue
Block a user