def UpdateStatus(id,status): """ >>> UpdateStatus(123456789,"TestStatus") TestName status is update """ data=Json.FetchJson() for c in data: if (str(id)==str(c['ID'])): print(c['Name']+" status is update") c["Status"]=status Json.SaveJason(data)
def CreateCV(name, edu, pic, id, exp, sLink='Unavailable'): data = Json.FetchJson() D = { 'Notes': "", 'Status': "Under review", 'Picture': CloudinaryP.upload(pic, id), 'Experience': exp, 'Education': edu, 'ID': id, 'Name': name, 'Social account': sLink } data.append(D) Json.SaveJason(data)
def AddNotes(id,note): """ >>> AddNotes(123456789,"TestNotes") Note add to TestName """ data=Json.FetchJson() for c in data: if (str(id)==str(c['ID'])): c["Notes"]=note print ("Note add to "+c['Name']) Json.SaveJason(data)
def EditCV(id, value, type='n'): """" >>> EditCV(123456789,"TestName",'n') The Name is update >>> EditCV(123456789,"TestEducation",'e') The Education is update >>> EditCV(123456789,"TestExp",'exp') The Experience is update """ data = Json.FetchJson() for c in data: if (str(id) == str(c['ID'])): if (type.lower() == 'n'): c['Name'] = value print("The Name is update") elif (type.lower() == 'e'): c['Education'] = value print("The Education is update") elif (type.lower() == 'exp'): c['Experience'] = value print("The Experience is update") Json.SaveJason(data)