def Serach(value): """ >>> Serach(123456789) Name: TestName ID: 123456789 Education: TestEducation Experience: TestExp Picture: TestPic Status: TestStatus Note: TestNotes <BLANKLINE> <BLANKLINE> """ data=Json.FetchJson() for c in data: if (str(value)==str(c['ID'])): print('Name: {}\nID: {}\nEducation: {}\nExperience: {}\nPicture: {}\nStatus: {}'.format(c['Name'], str(c['ID']),c['Education'],c['Experience'],c['Picture'],c['Status'],end='\n')) if c['Notes']: print ("Note:",c['Notes']) print('\n') if (str(value)==str(c['Education'])): print('Name: {}\nID: {}\nEducation: {}\nExperience: {}\nPicture: {}\nStatus: {}'.format(c['Name'], str(c['ID']),c['Education'],c['Experience'],c['Picture'],c['Status'], end='\n')) if c['Notes']: print ("Note:",c['Notes']) print('\n') if (str(value)==str(c['Experience'])): print('Name: {}\nID: {}\nEducation: {}\nExperience: {}\nPicture: {}\nStatus:{}'.format(c['Name'], str(c['ID']),c['Education'],c['Experience'],c['Picture'],c['Status'], end='\n')) if c['Notes']: print ("Note:",c['Notes']) print('\n')
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 CheckMyStatus(id): """ >>> CheckMyStatus(123456789) Name: TestName ID: 123456789 Education: TestEducation Experience: TestExp Picture: TestPic Status: TestStatus <BLANKLINE> """ data = Json.FetchJson() for c in data: if (str(id) == str(c['ID'])): print( 'Name: {}\nID: {}\nEducation: {}\nExperience: {}\nPicture: {}\nStatus: {}\n' .format(c['Name'], str(c['ID']), c['Education'], c['Experience'], c['Picture'], c['Status']))
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)