rest category & rest cuisine for favs
(cherry picked from commit 79a70fb)
This commit is contained in:
parent
912431690d
commit
0f11a47a79
|
|
@ -451,13 +451,17 @@ class EstablishmentSimilarSerializer(EstablishmentBaseSerializer):
|
|||
address = AddressDetailSerializer(read_only=True)
|
||||
schedule = ScheduleRUDSerializer(many=True, allow_null=True)
|
||||
type = EstablishmentTypeGeoSerializer(source='establishment_type')
|
||||
artisan_category = TagBaseSerializer(many=True, allow_null=True)
|
||||
artisan_category = TagBaseSerializer(many=True, allow_null=True, read_only=True)
|
||||
restaurant_category = TagBaseSerializer(many=True, allow_null=True, read_only=True)
|
||||
restaurant_cuisine = TagBaseSerializer(many=True, allow_null=True, read_only=True)
|
||||
|
||||
class Meta(EstablishmentBaseSerializer.Meta):
|
||||
fields = EstablishmentBaseSerializer.Meta.fields + [
|
||||
'schedule',
|
||||
'type',
|
||||
'artisan_category',
|
||||
'restaurant_category',
|
||||
'restaurant_cuisine',
|
||||
]
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -30,6 +30,8 @@ class FavoritesEstablishmentListView(generics.ListAPIView):
|
|||
"""Override get_queryset method"""
|
||||
return Establishment.objects.filter(favorites__user=self.request.user) \
|
||||
.order_by('-favorites').with_base_related() \
|
||||
.with_certain_tag_category_related('category', 'restaurant_category') \
|
||||
.with_certain_tag_category_related('cuisine', 'restaurant_cuisine') \
|
||||
.with_certain_tag_category_related('shop_category', 'artisan_category')
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user