minor changes for tags translation command

This commit is contained in:
Dmitriy Kuzmenko 2019-11-16 23:26:50 +03:00
parent 82c79091a3
commit 09db5c9540

View File

@ -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: