artisans tags for favs
(cherry picked from commit 7081e52)
This commit is contained in:
parent
d114b93b14
commit
1e0044cbd1
|
|
@ -427,11 +427,13 @@ class EstablishmentSimilarSerializer(EstablishmentBaseSerializer):
|
||||||
address = AddressDetailSerializer(read_only=True)
|
address = AddressDetailSerializer(read_only=True)
|
||||||
schedule = ScheduleRUDSerializer(many=True, allow_null=True)
|
schedule = ScheduleRUDSerializer(many=True, allow_null=True)
|
||||||
establishment_type = EstablishmentTypeGeoSerializer()
|
establishment_type = EstablishmentTypeGeoSerializer()
|
||||||
|
artisan_category = TagBaseSerializer(many=True, allow_null=True)
|
||||||
|
|
||||||
class Meta(EstablishmentBaseSerializer.Meta):
|
class Meta(EstablishmentBaseSerializer.Meta):
|
||||||
fields = EstablishmentBaseSerializer.Meta.fields + [
|
fields = EstablishmentBaseSerializer.Meta.fields + [
|
||||||
'schedule',
|
'schedule',
|
||||||
'establishment_type',
|
'establishment_type',
|
||||||
|
'artisan_category',
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,8 @@ class FavoritesEstablishmentListView(generics.ListAPIView):
|
||||||
def get_queryset(self):
|
def get_queryset(self):
|
||||||
"""Override get_queryset method"""
|
"""Override get_queryset method"""
|
||||||
return Establishment.objects.filter(favorites__user=self.request.user) \
|
return Establishment.objects.filter(favorites__user=self.request.user) \
|
||||||
.order_by('-favorites').with_base_related()
|
.order_by('-favorites').with_base_related() \
|
||||||
|
.with_certain_tag_category_related('shop_category', 'artisan_category')
|
||||||
|
|
||||||
|
|
||||||
class FavoritesProductListView(generics.ListAPIView):
|
class FavoritesProductListView(generics.ListAPIView):
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user