Merge branch 'bugs/optimize-translation-request' into 'develop'
Bugs/optimize translation request See merge request gm/gm-backend!221
This commit is contained in:
commit
306b189725
18
apps/translation/migrations/0008_index_siteifdict_text.py
Normal file
18
apps/translation/migrations/0008_index_siteifdict_text.py
Normal file
|
|
@ -0,0 +1,18 @@
|
||||||
|
# Generated by Django 2.2.7 on 2020-01-17 22:01
|
||||||
|
|
||||||
|
import django.contrib.postgres.indexes
|
||||||
|
from django.db import migrations
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('translation', '0007_language_is_active'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.AddIndex(
|
||||||
|
model_name='siteinterfacedictionary',
|
||||||
|
index=django.contrib.postgres.indexes.GinIndex(fields=['text'], name='translation_text_0b2bfa_gin'),
|
||||||
|
),
|
||||||
|
]
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
"""Translation app models."""
|
"""Translation app models."""
|
||||||
from django.contrib.postgres.fields import JSONField
|
from django.contrib.postgres.fields import JSONField
|
||||||
|
from django.contrib.postgres.indexes import GinIndex
|
||||||
from django.db import models
|
from django.db import models
|
||||||
from django.utils.translation import gettext_lazy as _
|
from django.utils.translation import gettext_lazy as _
|
||||||
from django.apps import apps
|
from django.apps import apps
|
||||||
|
|
@ -105,6 +106,9 @@ class SiteInterfaceDictionary(ProjectBaseMixin):
|
||||||
|
|
||||||
verbose_name = _('Site interface dictionary')
|
verbose_name = _('Site interface dictionary')
|
||||||
verbose_name_plural = _('Site interface dictionary')
|
verbose_name_plural = _('Site interface dictionary')
|
||||||
|
indexes = [
|
||||||
|
GinIndex(fields=['text'])
|
||||||
|
]
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
return f'{self.page}: {self.keywords}'
|
return f'{self.page}: {self.keywords}'
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user