title: How to reference generated permissions in Django 1.7 migrations
body: <p>I'm trying to create a auth.Group with permissions automaticly with migrations. My problem is that when I run migrate on empty database the migration that tries to attach permission to the group can't find the permission. If I target an earlier migration so that migrate exits without an error the permissions appear into the database and after that the migration code can find the permission. So what can I do so that the migration can reference a permission which is created in an earlier migration when the migrations are run back to back?</p>
  
  <pre><code>def load_data(apps, schema_editor):
      Permission  = apps.get_model('auth', 'Permission')
      Group       = apps.get_model('auth', 'Group')
  
      can_add = Permission.objects.get(codename='add_game')
      developers = Group.objects.create(name='Developer')
  
      developers.permissions.add(can_add)
      developers.save()
  
  
  class Migration(migrations.Migration):
  
      dependencies = [
          ('myApp', '0004_game'),
      ]
  
      operations = [
          migrations.RunPython(load_data),
      ]
  </code></pre>
  
  <p>The game model is created in an earlier migration. This code causes always an error stating that Permission matching query does not exist when I run it with other migrations on an empty database.
  I'm using python 3.4 with django 1.7.2</p>