Ejemplo n.º 1
0
 def get(self, search_term):
     if len(search_term) < 3:
         return {'message': "Please search for a term at least 3 characters long."}, 400
     entries = IcdModel.search(search_term)
     if entries:
         return {'results': [entry.json() for entry in entries]}, 200
     return {'message': "No results match the search term '{}'.".format(search_term)}, 404
Ejemplo n.º 2
0
 def get(self, search_term):
     entries = IcdModel.search(search_term)
     if entries:
         return {'results': [entry.json() for entry in entries]}, 200
     return {'message': "No results match the search term '{}'.".format(search_term)}, 404