@@ -0,0 +1,1405 @@
+import pandas as pd%0A%0Afrom django.core.management.base import BaseCommand%0A%0Afrom lowfat.models import Fund%0A%0Aclass Command(BaseCommand):%0A    help = %22Fix grant%22%0A%0A    def add_arguments(self, parser):%0A        parser.add_argument('csv', nargs='?', default='activities.csv')%0A%0A    # pylint: disable=too-many-branches,too-many-locals%0A    def handle(self, *args, **options):%0A        data = pd.read_csv(options%5B'csv'%5D)%0A        for index, line in data.iterrows():  # pylint: disable=no-member,unused-variable%0A            try:%0A                funds = Fund.objects.filter(%0A                    claimant__forenames=line%5B%22fornames%22%5D,%0A                    claimant__surname=line%5B%22surname%22%5D,%0A                    title=line%5B%22title%22%5D%0A                    )%0A                for fund in funds:%0A                    fund.grant = line%5B%22grant%22%5D%0A                    if line%5B%22grant_heading%22%5D == %22Fellowship%22:%0A                        fund.grant_heading = %22F%22%0A                    elif line%5B%22grant_heading%22%5D == %22Core%22:%0A                        fund.grant_heading = %22I%22%0A                    elif line%5B%22grant_heading%22%5D == %22Continuing%22:%0A                        fund.grant_heading = %22C%22%0A%0A                    print(%22Changing %7B%7D...%22.format(fund))%0A                    fund.save()%0A                    print(%22Changed %7B%7D...%22.format(fund))%0A%0A            except BaseException as exception:%0A                print(%22Error: %7B%7D%5Cn%5Ct%7B%7D%22.format(exception, line))%0A

Add fixgrant.py