I'm trying to create a database in Django with data stored in json.
{
'Vincent van Gogh':
{'The Starry Night': ['starryLink'],
'Irises': ['irisesLink']},
'Leonardo da Vinci':
{'Mona Lisa': ['monalisalink'],
'The Last Supper': ['lastsupperlink']},
}
Do I need to rewrite the above json into the format below?
[
{
"model": "model.artistModel",
"pk": 1,
"fields": {
"artist": "Vincent van Gogh",
"title": "The Starry Night",
"link": ["link.com"]
}
},
I saw some examples of creating a Django db from a json but none looked like my json file. Do I have to script my data into a db with loops and such or can Django do it automatically?