@@ -0,0 +1,878 @@
+from collections import defaultdict%0Afrom django.core.management.base import BaseCommand%0Afrom xbrowse_server.base.models import User, Project, Family, AnalysisStatus%0A%0Aclass Command(BaseCommand):%0A    %22%22%22Command to print out basic stats on some or all projects. Optionally takes a list of project_ids. %22%22%22%0A%0A    def handle(self, *args, **options):%0A        counter = defaultdict(int)%0A        for family in Family.objects.all():%0A            counter%5B'total'%5D += 1%0A            if family.analysis_status:%0A                analysis_status, created = AnalysisStatus.objects.get_or_create(family=family)%0A                analysis_status.status=family.analysis_status%0A                analysis_status.save()%0A                counter%5B'modified'%5D += 1%0A%0A        print(%22%25s of %25s (%25s%25%25) families migrated%22 %25 (counter%5B'modified'%5D, counter%5B'total'%5D, 100.0*counter%5B'modified'%5D/float(counter%5B'total'%5D)))%0A

copy Family.analysis_status field to the new AnalysisStatus model + database table