News multilang slug (ES)
This commit is contained in:
parent
4010c9fede
commit
c1bb7c9b79
17
apps/news/migrations/0040_remove_news_slug.py
Normal file
17
apps/news/migrations/0040_remove_news_slug.py
Normal file
|
|
@ -0,0 +1,17 @@
|
||||||
|
# Generated by Django 2.2.7 on 2019-12-10 16:22
|
||||||
|
|
||||||
|
from django.db import migrations
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('news', '0039_news_slugs'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.RemoveField(
|
||||||
|
model_name='news',
|
||||||
|
name='slug',
|
||||||
|
),
|
||||||
|
]
|
||||||
|
|
@ -181,8 +181,6 @@ class News(GalleryModelMixin, BaseAttributes, TranslatedFieldsMixin, HasTagsMixi
|
||||||
verbose_name=_('Start'))
|
verbose_name=_('Start'))
|
||||||
end = models.DateTimeField(blank=True, null=True, default=None,
|
end = models.DateTimeField(blank=True, null=True, default=None,
|
||||||
verbose_name=_('End'))
|
verbose_name=_('End'))
|
||||||
slug = models.SlugField(unique=True, max_length=255,
|
|
||||||
verbose_name=_('News slug'))
|
|
||||||
slugs = HStoreField(null=True, blank=True, default=None,
|
slugs = HStoreField(null=True, blank=True, default=None,
|
||||||
verbose_name=_('Slugs for current news obj'),
|
verbose_name=_('Slugs for current news obj'),
|
||||||
help_text='{"en-GB":"some slug"}')
|
help_text='{"en-GB":"some slug"}')
|
||||||
|
|
|
||||||
|
|
@ -80,7 +80,7 @@ class NewsBaseSerializer(ProjectModelSerializer):
|
||||||
'is_highlighted',
|
'is_highlighted',
|
||||||
'news_type',
|
'news_type',
|
||||||
'tags',
|
'tags',
|
||||||
'slug',
|
'slugs',
|
||||||
'view_counter',
|
'view_counter',
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@ from establishment import models
|
||||||
|
|
||||||
EstablishmentIndex = Index(settings.ELASTICSEARCH_INDEX_NAMES.get(__name__,
|
EstablishmentIndex = Index(settings.ELASTICSEARCH_INDEX_NAMES.get(__name__,
|
||||||
'establishment'))
|
'establishment'))
|
||||||
EstablishmentIndex.settings(number_of_shards=1, number_of_replicas=1)
|
EstablishmentIndex.settings(number_of_shards=5, number_of_replicas=2)
|
||||||
|
|
||||||
|
|
||||||
@EstablishmentIndex.doc_type
|
@EstablishmentIndex.doc_type
|
||||||
|
|
|
||||||
|
|
@ -17,6 +17,7 @@ class NewsDocument(Document):
|
||||||
'name': fields.KeywordField()})
|
'name': fields.KeywordField()})
|
||||||
title = fields.ObjectField(attr='title_indexing',
|
title = fields.ObjectField(attr='title_indexing',
|
||||||
properties=OBJECT_FIELD_PROPERTIES)
|
properties=OBJECT_FIELD_PROPERTIES)
|
||||||
|
slugs = fields.ObjectField(properties=OBJECT_FIELD_PROPERTIES)
|
||||||
backoffice_title = fields.TextField(analyzer='english')
|
backoffice_title = fields.TextField(analyzer='english')
|
||||||
subtitle = fields.ObjectField(attr='subtitle_indexing',
|
subtitle = fields.ObjectField(attr='subtitle_indexing',
|
||||||
properties=OBJECT_FIELD_PROPERTIES)
|
properties=OBJECT_FIELD_PROPERTIES)
|
||||||
|
|
@ -50,7 +51,6 @@ class NewsDocument(Document):
|
||||||
fields = (
|
fields = (
|
||||||
'id',
|
'id',
|
||||||
'end',
|
'end',
|
||||||
'slug',
|
|
||||||
'state',
|
'state',
|
||||||
'is_highlighted',
|
'is_highlighted',
|
||||||
'template',
|
'template',
|
||||||
|
|
|
||||||
|
|
@ -221,7 +221,7 @@ class NewsDocumentSerializer(InFavoritesMixin, DocumentSerializer):
|
||||||
'news_type',
|
'news_type',
|
||||||
'tags',
|
'tags',
|
||||||
'start',
|
'start',
|
||||||
'slug',
|
'slugs',
|
||||||
)
|
)
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user