def get(self, type_name): if type_name: flag_class = get_flag_class(type_name) response = {"name": flag_class.name, "templates": flag_class.templates} return {"success": True, "data": response} else: response = {} for class_id in FLAG_CLASSES: flag_class = FLAG_CLASSES.get(class_id) response[class_id] = { "name": flag_class.name, "templates": flag_class.templates, } return {"success": True, "data": response}
def get(self, type_name): if type_name: flag_class = get_flag_class(type_name) response = { 'name': flag_class.name, 'templates': flag_class.templates } return {'success': True, 'data': response} else: response = {} for class_id in FLAG_CLASSES: flag_class = FLAG_CLASSES.get(class_id) response[class_id] = { 'name': flag_class.name, 'templates': flag_class.templates, } return {'success': True, 'data': response}