Use a materialized Extension.latest_version field instead of a dynamic property #152

Merged
Oleg-Komarov merged 15 commits from latest-version-field into main 2024-05-27 17:58:56 +02:00
Showing only changes of commit 00711657af - Show all commits

View File

@ -37,13 +37,12 @@ class HomeView(ListedExtensionsView):
.get_queryset()
.prefetch_related(
'authors',
'latest_version__file',
'latest_version__tags',
'preview_set',
'preview_set__file',
'ratings',
'team',
'versions',
'versions__file',
'versions__tags',
)
)
context['addons'] = q.filter(type=EXTENSION_TYPE_CHOICES.BPY)[:8]
@ -100,13 +99,13 @@ class SearchView(ListedExtensionsView):
queryset = queryset.filter(search_query).distinct()
return queryset.prefetch_related(
'authors',
'latest_version__file',
'latest_version__tags',
'preview_set',
'preview_set__file',
'ratings',
'team',
'versions',
'versions__file',
'versions__tags',
)
def get_context_data(self, **kwargs):