From b34ab11fd881ef98244895254ff84c6326b93260 Mon Sep 17 00:00:00 2001 From: Kuroshini Date: Mon, 16 Dec 2019 23:48:55 +0300 Subject: [PATCH] description news availability management from BO --- .../news/migrations/0044_auto_20191216_2044.py | 18 ++++++++++++++++++ apps/news/models.py | 2 +- apps/news/serializers.py | 1 + 3 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 apps/news/migrations/0044_auto_20191216_2044.py diff --git a/apps/news/migrations/0044_auto_20191216_2044.py b/apps/news/migrations/0044_auto_20191216_2044.py new file mode 100644 index 00000000..3854cc70 --- /dev/null +++ b/apps/news/migrations/0044_auto_20191216_2044.py @@ -0,0 +1,18 @@ +# Generated by Django 2.2.7 on 2019-12-16 20:44 + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('news', '0043_auto_20191216_1920'), + ] + + operations = [ + migrations.RenameField( + model_name='news', + old_name='description_to_locale_is_active', + new_name='locale_to_description_is_active', + ), + ] diff --git a/apps/news/models.py b/apps/news/models.py index 9a463026..149b8480 100644 --- a/apps/news/models.py +++ b/apps/news/models.py @@ -179,7 +179,7 @@ class News(GalleryModelMixin, BaseAttributes, TranslatedFieldsMixin, HasTagsMixi description = TJSONField(blank=True, null=True, default=None, verbose_name=_('description'), help_text='{"en-GB":"some text"}') - description_to_locale_is_active = HStoreField(null=True, default=dict, blank=True, + locale_to_description_is_active = HStoreField(null=True, default=dict, blank=True, verbose_name=_('Is description for certain locale active'), help_text='{"en-GB": true, "fr-FR": false}') start = models.DateTimeField(blank=True, null=True, default=None, diff --git a/apps/news/serializers.py b/apps/news/serializers.py index 59076776..ad29f1ac 100644 --- a/apps/news/serializers.py +++ b/apps/news/serializers.py @@ -182,6 +182,7 @@ class NewsBackOfficeBaseSerializer(NewsBaseSerializer): 'backoffice_title', 'subtitle', 'slugs', + 'locale_to_description_is_active', 'is_published', 'duplication_date', )