Skip to content

Commit

Permalink
[#1633] Fixes to migration 0024
Browse files Browse the repository at this point in the history
Add some more diagnostic output

Fix label characters
  • Loading branch information
zzgvh committed Aug 20, 2015
1 parent 4a388d3 commit b0ba0a2
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion akvo/rsr/migrations/0024_auto_20150819_1149.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {}
Expand Down

0 comments on commit b0ba0a2

Please sign in to comment.