fix product view mixins
This commit is contained in:
parent
0639aee494
commit
d3faacba3b
|
|
@ -265,8 +265,10 @@ class Product(GalleryModelMixin, TranslatedFieldsMixin, BaseAttributes, HasTagsM
|
|||
|
||||
@property
|
||||
def related_tags(self):
|
||||
return super().visible_tags.exclude(category__index_name__in=['sugar-content', 'wine-color',
|
||||
'bottles-produced','serial-number', 'grape-variety'])
|
||||
return super().visible_tags.exclude(category__index_name__in=[
|
||||
'sugar-content', 'wine-color', 'bottles-produced',
|
||||
'serial-number', 'grape-variety']
|
||||
)
|
||||
|
||||
@property
|
||||
def display_name(self):
|
||||
|
|
|
|||
|
|
@ -17,7 +17,6 @@ class ProductBaseView(generics.GenericAPIView):
|
|||
return Product.objects.published() \
|
||||
.with_base_related() \
|
||||
.annotate_in_favorites(self.request.user) \
|
||||
.by_country_code(self.request.country_code) \
|
||||
.order_by('-created')
|
||||
|
||||
|
||||
|
|
@ -27,7 +26,8 @@ class ProductListView(ProductBaseView, generics.ListAPIView):
|
|||
filter_class = filters.ProductFilterSet
|
||||
|
||||
def get_queryset(self):
|
||||
qs = super().get_queryset().with_extended_related()
|
||||
qs = super().get_queryset().with_extended_related() \
|
||||
.by_country_code(self.request.country_code)
|
||||
return qs
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user