diff --git a/apps/main/management/commands/add_award.py b/apps/main/management/commands/add_award.py index 85a613cf..b7abd20d 100644 --- a/apps/main/management/commands/add_award.py +++ b/apps/main/management/commands/add_award.py @@ -3,6 +3,7 @@ from django.db import connections from establishment.management.commands.add_position import namedtuplefetchall from main.models import Award, AwardType from establishment.models import Employee +from tqdm import tqdm class Command(BaseCommand): @@ -25,7 +26,7 @@ class Command(BaseCommand): def handle(self, *args, **kwargs): objects =[] - for a in self.award_sql(): + for a in tqdm(self.award_sql(), desc='Add award to profile'): profile = Employee.objects.filter(old_id=a.profile_id).first() type = AwardType.objects.filter(old_id=a.award_type).first() state = Award.PUBLISHED if a.state == 'published' else Award.WAITING diff --git a/apps/main/management/commands/add_award_type.py b/apps/main/management/commands/add_award_type.py index 63aa6546..eb693ad2 100644 --- a/apps/main/management/commands/add_award_type.py +++ b/apps/main/management/commands/add_award_type.py @@ -3,7 +3,7 @@ from django.db import connections from establishment.management.commands.add_position import namedtuplefetchall from main.models import AwardType from location.models import Country - +from tqdm import tqdm class Command(BaseCommand): help = '''Add award types from old db to new db. @@ -24,7 +24,7 @@ class Command(BaseCommand): def handle(self, *args, **kwargs): objects =[] - for a in self.award_types_sql(): + for a in tqdm(self.award_types_sql(), desc='Add award types: '): country = Country.objects.filter(code=a.country_code).first() if country: type = AwardType(name=a.name, old_id=a.id)