Spaces:
Running
Running
with open("./api/bhajanData.json", "r",encoding="utf-8") as f: | |
data = json.load(f)["Prasang"] | |
for bhajan in data: | |
category = BhajanCategory.objects.filter(link=bhajan['CatId']).first() | |
Bhajan.objects.create( | |
title=bhajan['title'], | |
title_guj=bhajan['title_guj'], | |
category=category, | |
lyrics=bhajan['lyrics'], | |
isEng = bhajan['isEng'], | |
isHnd = bhajan['isHnd'], | |
isGer = bhajan['isGer'], | |
isAudio = bhajan['isAudio'], | |
audio_url=bhajan['audio_url'] if bhajan['isAudio'] else "" | |
) | |
print(bhajan['title']) |