from django.core.management.base import BaseCommand
from ldt.ldt_utils.models import Project

class Command(BaseCommand):
    help = 'Set icon for every project'
    
    def handle(self, *args, **options):
        
        new_icons = 0
        for project in Project.objects.all():
            if project.set_icon():
                new_icons += 1
                project.save()
                
        print "%s icons set" % new_icons
                   
        