def convert2ui(self, idict, not2show=None): """ Convert input row (dict) into UI presentation """ for key in idict.keys(): if key == 'das' or key.find('_id') != -1: continue val = idict[key] if isinstance(val, list): for elem in val: if 'error' in elem: yield 'error', elem['error'], None, None, None else: if 'error' in val: yield 'error', val['error'], None, None, None for item in self.dasmapping.presentation(key): try: daskey = item['das'] link = item.get('link', None) desc = item.get('description', None) exam = item.get('examples', None) if not2show and not2show == daskey: continue uikey = item['ui'] for value in access(idict, daskey): if value: yield uikey, value, link, desc, exam except: link = None desc = None exam = None yield key, idict[key], link, desc, exam
def convert2ui(self, idict): """ Convert input row (dict) into UI presentation """ for key in idict.keys(): if key == 'das' or key == '_id' or key == 'das_id': continue for item in self.dasmapping.presentation(key): try: daskey = item['das'] uikey = item['ui'] for value in access(idict, daskey): yield uikey, value except: yield key, idict[key]
def convert2ui(self, idict, not2show=None): """ Convert input row (dict) into UI presentation """ for key in idict.keys(): if key == 'das' or key.find('_id') != -1: continue for item in self.dasmapping.presentation(key): try: daskey = item['das'] if not2show and not2show == daskey: continue uikey = item['ui'] for value in access(idict, daskey): if value: yield uikey, value except: yield key, idict[key]