ES. Establishment. filter by collection_type

This commit is contained in:
evgeniy-st 2019-09-18 15:05:28 +03:00
parent 6e7a617a67
commit 3f55e001cc
3 changed files with 9 additions and 1 deletions

View File

@ -55,6 +55,10 @@ class EstablishmentDocument(Document):
),
}
)
collections = fields.ObjectField(properties={
'id': fields.IntegerField(attr='collection.id'),
'collection_type': fields.IntegerField(attr='collection.collection_type'),
})
class Django:

View File

@ -60,6 +60,7 @@ class EstablishmentDocumentSerializer(DocumentSerializer):
'description_translated',
'tags',
'address',
'collections',
)
@staticmethod

View File

@ -91,5 +91,8 @@ class EstablishmentDocumentViewSet(BaseDocumentViewSet):
},
'tags_category_id': {
'field': 'tags.category.id',
}
},
'collection_type': {
'field': 'collections.collection_type'
},
}