def lookup_logo_endpoint(): lookup_name = request.args.get('search_term') if lookup_name is not None: if request.endpoint == "equipment.operator": look_for = "operator" if request.endpoint == "equipment.manufacturer": look_for = "manufacturer" logo_url = equipment_logos.lookup_logo(lookup_name, look_for) if logo_url == "": return jsonify({'status': 'error'}) return jsonify ({ 'status': 'success', 'name': lookup_name, 'logo_url': logo_url })
def manufacturer_logo_url(self): return equipment_logos.lookup_logo(self.manufacturer, "manufacturer")
def operator_logo_url(self): return equipment_logos.lookup_logo(self.operator, "operator")