minor changes for tags translation command
This commit is contained in:
parent
82c79091a3
commit
09db5c9540
|
|
@ -8,8 +8,9 @@ from tqdm import tqdm
|
||||||
class Command(BaseCommand):
|
class Command(BaseCommand):
|
||||||
help = 'Add tags translation from old db to new db'
|
help = 'Add tags translation from old db to new db'
|
||||||
|
|
||||||
def humanization_tag(self):
|
@staticmethod
|
||||||
"""Humanisation for default values"""
|
def humanisation_tag(self):
|
||||||
|
"""Humanisation for default values."""
|
||||||
tags = Tag.objects.all()
|
tags = Tag.objects.all()
|
||||||
for tag in tqdm(tags):
|
for tag in tqdm(tags):
|
||||||
value = tag.label
|
value = tag.label
|
||||||
|
|
@ -21,8 +22,9 @@ class Command(BaseCommand):
|
||||||
tag.save()
|
tag.save()
|
||||||
|
|
||||||
def handle(self, *args, **kwargs):
|
def handle(self, *args, **kwargs):
|
||||||
|
"""Translation for existed tags."""
|
||||||
translation = legacy.MetadatumAliases.objects.all()
|
translation = legacy.MetadatumAliases.objects.all()
|
||||||
# self.humanization_tag()
|
# self.humanisation_tag()
|
||||||
for trans in tqdm(translation):
|
for trans in tqdm(translation):
|
||||||
tag = Tag.objects.filter(value=trans.value).first()
|
tag = Tag.objects.filter(value=trans.value).first()
|
||||||
if tag:
|
if tag:
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user