Experimental caching for the number of paid tickets

This commit is contained in:
Raphael Michel
2015-02-19 00:26:22 +01:00
parent 9f850f611c
commit 0fb7875c98
2 changed files with 13 additions and 6 deletions

View File

@@ -25,7 +25,7 @@ class EventIndex(EventViewMixin, CartDisplayMixin, TemplateView):
'category', # for re-grouping
).prefetch_related(
'properties', # for .get_all_available_variations()
'quotas', 'variations__quotas' # for .availability()
'quotas', 'variations__quotas', 'quotas__event' # for .availability()
).annotate(quotac=Count('quotas')).filter(
quotac__gt=0
).order_by('category__position', 'category_id', 'name')