ES. Establishment type & subtypes
This commit is contained in:
parent
4005fad64a
commit
8e0b19b8b0
|
|
@ -16,6 +16,19 @@ class EstablishmentDocument(Document):
|
||||||
|
|
||||||
description = fields.ObjectField(attr='description_indexing',
|
description = fields.ObjectField(attr='description_indexing',
|
||||||
properties=OBJECT_FIELD_PROPERTIES)
|
properties=OBJECT_FIELD_PROPERTIES)
|
||||||
|
establishment_type = fields.ObjectField(
|
||||||
|
properties={
|
||||||
|
'id': fields.IntegerField(),
|
||||||
|
'name': fields.ObjectField(attr='name_indexing',
|
||||||
|
properties=OBJECT_FIELD_PROPERTIES)
|
||||||
|
})
|
||||||
|
establishment_subtypes = fields.ObjectField(
|
||||||
|
properties={
|
||||||
|
'id': fields.IntegerField(),
|
||||||
|
'name': fields.ObjectField(attr='name_indexing',
|
||||||
|
properties=OBJECT_FIELD_PROPERTIES)
|
||||||
|
},
|
||||||
|
multi=True)
|
||||||
tags = fields.ObjectField(
|
tags = fields.ObjectField(
|
||||||
properties={
|
properties={
|
||||||
'id': fields.IntegerField(attr='metadata.id'),
|
'id': fields.IntegerField(attr='metadata.id'),
|
||||||
|
|
@ -55,10 +68,12 @@ class EstablishmentDocument(Document):
|
||||||
),
|
),
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
collections = fields.ObjectField(properties={
|
collections = fields.ObjectField(
|
||||||
|
properties={
|
||||||
'id': fields.IntegerField(attr='collection.id'),
|
'id': fields.IntegerField(attr='collection.id'),
|
||||||
'collection_type': fields.IntegerField(attr='collection.collection_type'),
|
'collection_type': fields.IntegerField(attr='collection.collection_type'),
|
||||||
})
|
},
|
||||||
|
multi=True)
|
||||||
|
|
||||||
class Django:
|
class Django:
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -61,6 +61,8 @@ class EstablishmentDocumentSerializer(DocumentSerializer):
|
||||||
'tags',
|
'tags',
|
||||||
'address',
|
'address',
|
||||||
'collections',
|
'collections',
|
||||||
|
'establishment_type',
|
||||||
|
'establishment_subtypes',
|
||||||
)
|
)
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
|
|
|
||||||
|
|
@ -97,6 +97,12 @@ class EstablishmentDocumentViewSet(BaseDocumentViewSet):
|
||||||
'collection_type': {
|
'collection_type': {
|
||||||
'field': 'collections.collection_type'
|
'field': 'collections.collection_type'
|
||||||
},
|
},
|
||||||
|
'establishment_type': {
|
||||||
|
'field': 'establishment_type.id'
|
||||||
|
},
|
||||||
|
'establishment_subtypes': {
|
||||||
|
'field': 'establishment_subtypes.id'
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
geo_spatial_filter_fields = {
|
geo_spatial_filter_fields = {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user