Merge branch 'develop' of ssh://gl.id-east.ru:222/gm/gm-backend into develop
This commit is contained in:
commit
0639aee494
|
|
@ -34,7 +34,7 @@ def transfer_languages():
|
||||||
|
|
||||||
def transfer_reviews():
|
def transfer_reviews():
|
||||||
establishments = Establishment.objects.filter(old_id__isnull=False).values_list('old_id', flat=True)
|
establishments = Establishment.objects.filter(old_id__isnull=False).values_list('old_id', flat=True)
|
||||||
queryset = Reviews.objects.filter(
|
queryset = Reviews.objects.exclude(product_id__isnull=False).filter(
|
||||||
establishment_id__in=list(establishments),
|
establishment_id__in=list(establishments),
|
||||||
).values('id', 'reviewer_id', 'aasm_state', 'created_at', 'establishment_id', 'mark', 'vintage')
|
).values('id', 'reviewer_id', 'aasm_state', 'created_at', 'establishment_id', 'mark', 'vintage')
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -52,6 +52,19 @@ class ProductDocument(Document):
|
||||||
),
|
),
|
||||||
}
|
}
|
||||||
),
|
),
|
||||||
|
'address': fields.ObjectField(
|
||||||
|
properties={
|
||||||
|
'city': fields.ObjectField(
|
||||||
|
properties={
|
||||||
|
'country': fields.ObjectField(
|
||||||
|
properties={
|
||||||
|
'code': fields.KeywordField()
|
||||||
|
}
|
||||||
|
)
|
||||||
|
}
|
||||||
|
)
|
||||||
|
}
|
||||||
|
)
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
wine_colors = fields.ObjectField(
|
wine_colors = fields.ObjectField(
|
||||||
|
|
|
||||||
|
|
@ -243,7 +243,7 @@ class ProductDocumentViewSet(BaseDocumentViewSet):
|
||||||
'lookups': [constants.LOOKUP_QUERY_IN],
|
'lookups': [constants.LOOKUP_QUERY_IN],
|
||||||
},
|
},
|
||||||
'country': {
|
'country': {
|
||||||
'field': 'wine_region.country.code',
|
'field': 'establishment.address.city.country.code',
|
||||||
},
|
},
|
||||||
'wine_colors_id': {
|
'wine_colors_id': {
|
||||||
'field': 'wine_colors.id',
|
'field': 'wine_colors.id',
|
||||||
|
|
|
||||||
|
|
@ -69,6 +69,7 @@ class ProductReviewSerializer(ReviewSerializer):
|
||||||
data.pop('reviewer_id')
|
data.pop('reviewer_id')
|
||||||
data.pop('product_id')
|
data.pop('product_id')
|
||||||
data.pop('aasm_state')
|
data.pop('aasm_state')
|
||||||
|
data.pop('establishment_id')
|
||||||
return data
|
return data
|
||||||
|
|
||||||
def create(self, validated_data):
|
def create(self, validated_data):
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user