def __get_displayfields(self, entity_dict):
        """
        Returns Entity displayname, displayinfo, displaytable fields.

        """
        result = {}
        for displayfield in ['displayname', 'displayinfo', 'displaytable', 'sort']:
            result[displayfield] = entity_dict.get(displayfield, '') if entity_dict.get(displayfield, '') else None
            for data_property in findTags(entity_dict.get(displayfield, ''), '@', '@'):
                dataproperty_dict = entity_dict.get('properties', {}).get(data_property, {})
                result[displayfield] = result[displayfield].replace('@%s@' % data_property, ', '.join(['%s' % x['value'] for x in dataproperty_dict.get('values', {}).values()])).replace('\n', ' ')

        result['displaytable_labels'] = self.__get_system_translation(field='displaytableheader', entity_definition_keyname=entity_dict.get('definition_keyname'))
        if not result['displaytable_labels']:
            result['displaytable_labels'] = entity_dict.get('displaytable', '') if entity_dict.get('displaytable', '') else None
            for data_property in findTags(entity_dict.get('displaytable', ''), '@', '@'):
                result['displaytable_labels'] = result['displaytable_labels'].replace(data_property % '@%s@', entity_dict.get('properties', {}).get(data_property, {}).get('label', ''))

        result['displaytable'] = result['displaytable'].split('|') if result['displaytable'] else None
        result['displaytable_labels'] = result['displaytable_labels'].split('|') if result['displaytable_labels'] else None

        if entity_dict.get('id', None) and entity_dict.get('sort_value', None) != result['sort']:
            self.db_execute('UPDATE entity SET sort = LEFT(%s, 100) WHERE id = %s', result['sort'], entity_dict.get('id'))

        return result
dataset/ETHPy150Open argoroots/Entu/app/main/db.py/Entity.__get_displayfields/swapped operands of `%`