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):
|
||||
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:
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user