Use a materialized Extension.latest_version field instead of a dynamic property #152
@ -37,13 +37,12 @@ class HomeView(ListedExtensionsView):
|
|||||||
.get_queryset()
|
.get_queryset()
|
||||||
.prefetch_related(
|
.prefetch_related(
|
||||||
'authors',
|
'authors',
|
||||||
|
'latest_version__file',
|
||||||
|
'latest_version__tags',
|
||||||
'preview_set',
|
'preview_set',
|
||||||
'preview_set__file',
|
'preview_set__file',
|
||||||
'ratings',
|
'ratings',
|
||||||
'team',
|
'team',
|
||||||
'versions',
|
|
||||||
'versions__file',
|
|
||||||
'versions__tags',
|
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
context['addons'] = q.filter(type=EXTENSION_TYPE_CHOICES.BPY)[:8]
|
context['addons'] = q.filter(type=EXTENSION_TYPE_CHOICES.BPY)[:8]
|
||||||
@ -100,13 +99,13 @@ class SearchView(ListedExtensionsView):
|
|||||||
queryset = queryset.filter(search_query).distinct()
|
queryset = queryset.filter(search_query).distinct()
|
||||||
return queryset.prefetch_related(
|
return queryset.prefetch_related(
|
||||||
'authors',
|
'authors',
|
||||||
|
'latest_version__file',
|
||||||
|
'latest_version__tags',
|
||||||
'preview_set',
|
'preview_set',
|
||||||
'preview_set__file',
|
'preview_set__file',
|
||||||
'ratings',
|
'ratings',
|
||||||
'team',
|
'team',
|
||||||
'versions',
|
'versions',
|
||||||
'versions__file',
|
|
||||||
'versions__tags',
|
|
||||||
)
|
)
|
||||||
|
|
||||||
def get_context_data(self, **kwargs):
|
def get_context_data(self, **kwargs):
|
||||||
|
Loading…
Reference in New Issue
Block a user