示例#1
0
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
        })
示例#2
0
 def manufacturer_logo_url(self):
     return equipment_logos.lookup_logo(self.manufacturer, "manufacturer")
示例#3
0
 def operator_logo_url(self):
     return equipment_logos.lookup_logo(self.operator, "operator")