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
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