Exemplo n.º 1
0
    def recommends_dish_list(self, tab):
        re_net_datas = self.get_recommends(tab)
        re_net_datas = dict_obj(re_net_datas)
        re_lst = None
        dish_lst = None

        if hasattr(re_net_datas, 'myRegularDishList') and  not empty_list(re_net_datas.myRegularDishList) :
            re_lst = re_net_datas.myRegularDishList
        if ConfigUtil.instance().other_recommend == True and  not empty_list(re_net_datas.othersRegularDishList) :
            re_lst = re_lst or []
            re_lst = re_lst + re_net_datas.othersRegularDishList
        if not re_lst:
            return ErrCode.not_recommend, None
        dish_lst = filter(lambda x: x.priceInCent and x.restaurant.available == True, re_lst)

        if empty_list(dish_lst):
            return ErrCode.not_filter_recommend, None
        # name | priceInCent
        return ErrCode.ok, dish_lst
Exemplo n.º 2
0
 def mc_time(self):
     mc_time_info = json.loads(self.get(mc_time_url()).content)
     mc_time_info = dict_obj(mc_time_info)
     return mc_time_info
Exemplo n.º 3
0
 def account_show_info(self):
     usr_info = json.loads(self.get(account_show_url()).content)
     usr_info = dict_obj(usr_info)
     return usr_info