+\r
+ ctype = orm['contenttypes.ContentType'].objects.get(name="comment").id\r
+ ntype = orm['contenttypes.ContentType'].objects.get(name="node").id\r
+\r
+ #Converting activity\r
+ activities = orm.Activity.objects.filter(content_type__id=ctype)\r
+ activity_count = activities.count()\r
+ print "Converting %d activity references:" % activity_count\r
+ progress = ProgressBar(activity_count)\r
+\r
+ for a in activities:\r
+ node = id_map.get(a.object_id, None)\r
+ if node:\r
+ a.content_type_id = ntype\r
+ a.object_id = node.id\r
+ a.save()\r
+\r
+ progress.update()\r
+\r
+ print "\n...done\n"\r