Reputation: 33625
On migration I need to create a relationship between activity and organisation where organisation has not been created. Below is what I have so far. I now need so somehow set the default=
to the new organisation created? i.e.
field=models.ForeignKey(related_name='activities', to='orss.Organisation' default=temp_org_just_created
Is this possible? If so how?
Upvotes: 1
Views: 77
Reputation: 126
There are two types of migrations, schema and data migrations. You'll need to run your schema migration first, and the data migration afterwards.
Upvotes: 1