Skip to content

Instantly share code, notes, and snippets.

@ddemid
Created December 8, 2014 13:13
Show Gist options
  • Save ddemid/c64606730a763586e46f to your computer and use it in GitHub Desktop.
Save ddemid/c64606730a763586e46f to your computer and use it in GitHub Desktop.
class Migration(DataMigration):
def forwards(self, orm):
for cr in orm['contacts.ContactRelation'].objects.all():
project = orm['pekama.Project'].objects.get(content_type=cr.content_type, object_id=cr.object_id)
cr.project = project
cr.save()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment