From b0ba0a205bb49bc8e1ad5d31c85cac5ee8a1ae0a Mon Sep 17 00:00:00 2001 From: Gabriel von Heijne Date: Thu, 20 Aug 2015 10:07:12 +0200 Subject: [PATCH] [#1633] Fixes to migration 0024 Add some more diagnostic output Fix label characters --- akvo/rsr/migrations/0024_auto_20150819_1149.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/akvo/rsr/migrations/0024_auto_20150819_1149.py b/akvo/rsr/migrations/0024_auto_20150819_1149.py index 002c64a164..db3fe6b4fa 100644 --- a/akvo/rsr/migrations/0024_auto_20150819_1149.py +++ b/akvo/rsr/migrations/0024_auto_20150819_1149.py @@ -13,10 +13,15 @@ def merge_keys(apps, schema_editor): u'C4C': u'Connect4Change', u'SRHR': u'SRHR Alliance', u'f4winternational': u'Football for Water', - u'IGG-water': u'IGG-water program', + u'IGG-Water': u'IGG-water program', } Keyword = apps.get_model('rsr', 'Keyword') Project = apps.get_model('rsr', 'Project') + print + print "Keyword distribution before migration:" + for keyword in Keyword.objects.all(): + projects = Project.objects.filter(keywords__exact=keyword) + print keyword.label, projects.count() # dict holding old labels as keys and the keword objects that replace the old labelled keywords keyword_merger_objects = {}