old_contents: # -*- coding: utf-8 -*-
  # Generated by Django 1.9.6 on 2016-05-29 14:22
  from __future__ import unicode_literals
  
  from django.db import migrations, models
  
  def populate_researchers(apps, schema_editor):
      Researcher = apps.get_model('papers', 'Researcher')
      Paper = apps.get_model('papers', 'Paper')
  
      for p in Paper.objects.all():
          for a in p.authors_list:
              if a['researcher_id']:
                  p.researchers.add(a['researcher_id'])
  
  def do_nothing(apps, schema_editor):
      pass
  
  class Migration(migrations.Migration):
  
      dependencies = [
          ('papers', '0029_delete_authors'),
      ]
  
      operations = [
          migrations.AddField(
              model_name='paper',
              name='researchers',
              field=models.ManyToManyField(blank=True, null=True, to='papers.Researcher'),
          ),
          migrations.RunPython(populate_researchers, do_nothing)
      ]
  
new_contents: # -*- coding: utf-8 -*-
  # Generated by Django 1.9.6 on 2016-05-29 14:22
  from __future__ import unicode_literals
  
  from django.db import migrations, models
  
  def populate_researchers(apps, schema_editor):
      Researcher = apps.get_model('papers', 'Researcher')
      Paper = apps.get_model('papers', 'Paper')
  
      for p in Paper.objects.all():
          for a in p.authors_list:
              if a['researcher_id']:
                  p.researchers.add(a['researcher_id'])
  
  def do_nothing(apps, schema_editor):
      pass
  
  class Migration(migrations.Migration):
  
      dependencies = [
          ('papers', '0029_delete_authors'),
      ]
  
      operations = [
          migrations.AddField(
              model_name='paper',
              name='researchers',
              field=models.ManyToManyField(to='papers.Researcher'),
          ),
          migrations.RunPython(populate_researchers, do_nothing)
      ]
  
subject: fix migration 0030