def makeDishobj(self): t = time.strptime("Monday 12:00:00", "%A %H:%M:%S") menu_item_client = MenuItemApiClient(KEY) menu_items = menu_item_client.search(locality = 'San Francisco', name = 'espresso', price__gte = 6) item = menu_items['objects'][0] d = Dish(item,t) return d
def dish_search(search_terms): menu_item_client= MenuItemApiClient(KEY) name = search_terms.get("search_query",'') city = search_terms.get("city",'') state = search_terms.get("state",'') response = menu_item_client.search(name=name,locality = city, region=state)["objects"] menu_items = [] if response: menu_items = [Dish(locu_object) for locu_object in response] menu_items = Search.filter_bad_results(menu_items, city, state) return menu_items
from locu import MenuItemApiClient menu_item_client = MenuItemApiClient("dfde5a3db7684a9955eed4596c6007ef18ed6ef7") menu_items = menu_item_client.search(locality = 'San Francisco', name = 'espresso', price__gte = 6) print menu_items['objects'][0]