@@ -0,0 +1,1208 @@
+# -*- coding: utf-8 -*-%0A# Generated by Django 1.10.6 on 2017-06-21 13:28%0Afrom __future__ import unicode_literals%0A%0Afrom django.db import migrations%0Afrom django.core.exceptions import ObjectDoesNotExist%0A%0Adef add_fs_examples(apps, schema_editor):%0A    Sound = apps.get_model('datasets', 'Sound')%0A    TaxonomyNode = apps.get_model('datasets', 'TaxonomyNode')%0A    Taxonomy = apps.get_model('datasets', 'Taxonomy')%0A    all_taxonomies = Taxonomy.objects.all()%0A%0A    # loop on all taxonomy%0A    for taxonomy in all_taxonomies:%0A        all_taxonomy_nodes = taxonomy.taxonomynode_set.all()%0A        #loop for adding example Sound relations%0A        for taxonomy_node in all_taxonomy_nodes:%0A            for freesound_id in taxonomy.data%5Btaxonomy_node.node_id%5D%5B'positive_examples_FS'%5D:%0A                try:%0A                    sound = Sound.objects.get(freesound_id=freesound_id)%0A                    taxonomy_node.freesound_examples.add(sound)%0A                except ObjectDoesNotExist:%0A                    continue%0A%0A%0Aclass Migration(migrations.Migration):%0A%0A    dependencies = %5B%0A        ('datasets', '0018_auto_20170620_1305'),%0A    %5D%0A%0A    operations = %5Bmigrations.RunPython(add_fs_examples, migrations.RunPython.noop),%0A    %5D%0A

Add migration for freesound examples