From 09db5c95409749fb3f54c4e0d0cdc3d73aeb5fd3 Mon Sep 17 00:00:00 2001 From: Dmitriy Kuzmenko Date: Sat, 16 Nov 2019 23:26:50 +0300 Subject: [PATCH] minor changes for tags translation command --- apps/tag/management/commands/add_tags_translation.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/apps/tag/management/commands/add_tags_translation.py b/apps/tag/management/commands/add_tags_translation.py index 485a7f11..a168d35e 100644 --- a/apps/tag/management/commands/add_tags_translation.py +++ b/apps/tag/management/commands/add_tags_translation.py @@ -8,8 +8,9 @@ from tqdm import tqdm class Command(BaseCommand): help = 'Add tags translation from old db to new db' - def humanization_tag(self): - """Humanisation for default values""" + @staticmethod + def humanisation_tag(self): + """Humanisation for default values.""" tags = Tag.objects.all() for tag in tqdm(tags): value = tag.label @@ -21,8 +22,9 @@ class Command(BaseCommand): tag.save() def handle(self, *args, **kwargs): + """Translation for existed tags.""" translation = legacy.MetadatumAliases.objects.all() - # self.humanization_tag() + # self.humanisation_tag() for trans in tqdm(translation): tag = Tag.objects.filter(value=trans.value).first() if tag: