from django.core.management import BaseCommand

from users.models import SchoolClass


class Command(BaseCommand):
    def handle(self, *args, **options):
        self.stdout.write("Generating School Class codes")
        for sc in SchoolClass.objects.filter(code__isnull=True):
            sc.generate_code()
