I am a programming self-learner and I am new to python and django and would like to optimize my code.
My problem is that I want to do a get_or_create with some loaded json data. Each dictionary entry is directly linked to my model. example:
data=json.load(file)
Person.objects.get_or_create(
firstname=data['firstname'],
surname=data['surname'],
gender=data['gender'],
datebirth=data['datebirth'],
)
Are there any ways to automatically link the json properties to my model fields instead of typing all my properties one by one?