38π
β
A foreign key is simple the pk of the object you are linking to, a manytomanyfield uses a list of pkβs. so
[
{
"pk":1,
"model":farm.fruit,
"fields":{
"name" : "Apple",
"color" : "Green",
}
},
{
"pk":2,
"model":farm.fruit,
"fields":{
"name" : "Orange",
"color" : "Orange",
}
},
{
"pk":3,
"model":person.farmer,
"fields":{
"name":"Bill",
"favorite":1,
"likes":[1,2],
}
}
]
You will need to probably write a conversion script to get this done. Fixtures can be very flimsy; itβs difficult to get the working so experiment with a subset before you spend a lot of time converting the 30k records (only to find they might not import)
π€Timmy O'Mahony
Source:stackexchange.com