added field - "distillery_types" to ES, change country field properties in TagCategory model
This commit is contained in:
parent
f93337def3
commit
c1186dd597
|
|
@ -85,6 +85,14 @@ class EstablishmentDocument(Document):
|
||||||
'value': fields.KeywordField(),
|
'value': fields.KeywordField(),
|
||||||
},
|
},
|
||||||
multi=True)
|
multi=True)
|
||||||
|
distillery_types = fields.ObjectField(
|
||||||
|
properties={
|
||||||
|
'id': fields.IntegerField(attr='id'),
|
||||||
|
'label': fields.ObjectField(attr='label_indexing',
|
||||||
|
properties=OBJECT_FIELD_PROPERTIES),
|
||||||
|
'value': fields.KeywordField(),
|
||||||
|
},
|
||||||
|
multi=True)
|
||||||
products = fields.ObjectField(
|
products = fields.ObjectField(
|
||||||
properties={
|
properties={
|
||||||
'wine_origins': fields.ListField(
|
'wine_origins': fields.ListField(
|
||||||
|
|
|
||||||
|
|
@ -277,6 +277,7 @@ class EstablishmentDocumentSerializer(InFavoritesMixin, DocumentSerializer):
|
||||||
tags = TagsDocumentSerializer(many=True, source='visible_tags')
|
tags = TagsDocumentSerializer(many=True, source='visible_tags')
|
||||||
restaurant_category = TagsDocumentSerializer(many=True, allow_null=True)
|
restaurant_category = TagsDocumentSerializer(many=True, allow_null=True)
|
||||||
restaurant_cuisine = TagsDocumentSerializer(many=True, allow_null=True)
|
restaurant_cuisine = TagsDocumentSerializer(many=True, allow_null=True)
|
||||||
|
distillery_types = TagsDocumentSerializer(many=True, allow_null=True)
|
||||||
artisan_category = TagsDocumentSerializer(many=True, allow_null=True)
|
artisan_category = TagsDocumentSerializer(many=True, allow_null=True)
|
||||||
schedule = ScheduleDocumentSerializer(many=True, allow_null=True)
|
schedule = ScheduleDocumentSerializer(many=True, allow_null=True)
|
||||||
wine_origins = WineOriginSerializer(many=True)
|
wine_origins = WineOriginSerializer(many=True)
|
||||||
|
|
@ -310,6 +311,7 @@ class EstablishmentDocumentSerializer(InFavoritesMixin, DocumentSerializer):
|
||||||
# 'collections',
|
# 'collections',
|
||||||
'type',
|
'type',
|
||||||
'subtypes',
|
'subtypes',
|
||||||
|
'distillery_types',
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
19
apps/tag/migrations/0018_auto_20200113_1357.py
Normal file
19
apps/tag/migrations/0018_auto_20200113_1357.py
Normal file
|
|
@ -0,0 +1,19 @@
|
||||||
|
# Generated by Django 2.2.7 on 2020-01-13 13:57
|
||||||
|
|
||||||
|
from django.db import migrations, models
|
||||||
|
import django.db.models.deletion
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('tag', '0017_auto_20191220_1623'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.AlterField(
|
||||||
|
model_name='tagcategory',
|
||||||
|
name='country',
|
||||||
|
field=models.ForeignKey(blank=True, default=None, null=True, on_delete=django.db.models.deletion.SET_NULL, to='location.Country'),
|
||||||
|
),
|
||||||
|
]
|
||||||
|
|
@ -145,8 +145,8 @@ class TagCategory(models.Model):
|
||||||
(BOOLEAN, _('boolean')),
|
(BOOLEAN, _('boolean')),
|
||||||
)
|
)
|
||||||
country = models.ForeignKey('location.Country',
|
country = models.ForeignKey('location.Country',
|
||||||
on_delete=models.SET_NULL, null=True,
|
on_delete=models.SET_NULL,
|
||||||
default=None)
|
blank=True, null=True, default=None)
|
||||||
public = models.BooleanField(default=False)
|
public = models.BooleanField(default=False)
|
||||||
index_name = models.CharField(max_length=255, blank=True, null=True,
|
index_name = models.CharField(max_length=255, blank=True, null=True,
|
||||||
verbose_name=_('indexing name'), unique=True)
|
verbose_name=_('indexing name'), unique=True)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user