Skip to content

Commit

Permalink
possible solution to awesto#791
Browse files Browse the repository at this point in the history
  • Loading branch information
jrief committed Jan 15, 2020
1 parent 6b65222 commit 57f9729
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion shop/search/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@ class CMSPageCatalogWrapper(object):
:param filter_class: A filter set which must inherit from :class:`django_filters.FilterSet`.
:param pagination_class: A pagination class inheriting from :class:`rest_framework.pagination.BasePagination`.
:param search_serializer_class: The serializer class used to process the queryset returned
by Haystack, while performing an autocomplete lookup.
Expand All @@ -96,6 +98,7 @@ class CMSPageCatalogWrapper(object):
limit_choices_to = models.Q()
search_serializer_class = None # must be overridden by CMSPageCatalogWrapper.as_view()
model_serializer_class = app_settings.PRODUCT_SUMMARY_SERIALIZER # may be overridden by CMSPageCatalogWrapper.as_view()
pagination_class = ProductListPagination
filter_class = None # may be overridden by CMSPageCatalogWrapper.as_view()
filter_backends = [CMSPagesFilterBackend] + list(api_settings.DEFAULT_FILTER_BACKENDS)
cms_pages_fields = ['cms_pages']
Expand All @@ -116,7 +119,8 @@ def as_view(cls, **initkwargs):

bases = (AddFilterContextMixin, AddSearchContextMixin, CMSPageSearchMixin, SearchView)
attrs = dict(renderer_classes=self.renderer_classes, product_model=self.product_model,
limit_choices_to=self.limit_choices_to, filter_class=self.filter_class)
limit_choices_to=self.limit_choices_to, filter_class=self.filter_class,
pagination_class=self.pagination_class)
self.search_view = type(str('CatalogSearchView'), bases, attrs).as_view(
serializer_class=self.search_serializer_class,
)
Expand Down

0 comments on commit 57f9729

Please sign in to comment.