def post(self): echo_dist = {} if self.session['ManagerUid'] == None: # 退出 echo_dist['reponse_status'] = -1 else: # print("SS:", self.request.arguments) fx_type = self.get_argument("fx_type", None) if fx_type == "edit_verify": P = ProxyOrderModel() a_data = yield P.getProxyAccount(0) if len(a_data) > 0: for a_data_v in a_data: a_flag = yield P.editPAVerify2(a_data_v['account']) if a_flag == 5: echo_dist['echo'] = str( a_data_v['account']) + "激活成功<BR>" echo_dist['reponse_status'] = 5 else: echo_dist['echo'] = str( a_data_v['account']) + "激活失败<BR>" echo_dist['reponse_status'] = 5 else: echo_dist['reponse_status'] = 10 echo_dist['echo'] = "激活执行程序完成<BR>" else: # 表单错误 echo_dist['reponse_status'] = -1 echo_dist['echo'] = "非法执行<BR>" # print(echo_dist) from models.public.headers_model import DateEncoder yield self.write(json.dumps(echo_dist, cls=DateEncoder)) # self.write(json.dumps(echo_dist)) self.finish()
def get(self): page_main = {} page_main['lang'] = self.get_lang() page_main['title_website'] = config.WEBSITE_NAME page_main['title_type'] = "账户批量激活" if self.session['ManagerUid'] == None: # 退出 # yield self.render("user/login.html", page_main=page_main) yield self.render("admin/login.html", page_main=page_main) return else: fx_type = self.get_argument("fx_type", None) P = ProxyOrderModel() if fx_type: # cookie_dist = self.getCookie() # page_main.update(cookie_dist) page_main['text'] = "账户自动激活程序,非法......" else: # 第一次 page_main['one_num'] = yield P.editPAVerify3() page_main['text'] = "账户自动激活程序,开始......" yield self.render('admin/index_proxy_account_verify.html', page_main=page_main, session=self.session) return self.finish()
def get(self): page_main = {} page_main['lang'] = self.get_lang() page_main['title_website'] = config.WEBSITE_NAME if self.session['swissquote_uid'] == None: # 退出 # yield self.render("user/login.html", page_main=page_main) yield self.redirect("/swissquote") return else: F = ProxyInfoForm(self.request.arguments) if F.validate(): # cookie_dist = self.getCookie() # page_main.update(cookie_dist) page_main['prc_type'] = F.fx_type.data P = ProxyOrderModel() if F.fx_type.data == "edit_proxy": # 修改代理资料 data = yield P.CheckProxyInfo(self.session['swissquote_uid']) if len(data) > 0: page_main['uname'] = data[0]['uname'] page_main['iban'] = data[0]['iban'] page_main['flag'] = data[0]['flag'] page_main['title_type'] = self.locale.translate("修改返佣资料") else: # yield P.add_proxy_info(self.session['swissquote_uid']) page_main['uname'] = "" page_main['iban'] = "" page_main['flag'] = 0 page_main['title_type'] = self.locale.translate("新增返佣资料") yield self.render("user/swissquote_index_edit_proxy_info.html", page_main=page_main, session=self.session) return elif F.fx_type.data == "list_proxy_account": # 列表 page_main['title_type'] = self.locale.translate("账户管理") page_main['text1'] = self.locale.translate("通过本站开户专属链接开户成功、入金并开通MT4账户后, 可通过右边的") page_main['text2'] = self.locale.translate("新增账户, 完成第一笔交易并平仓后, 可激活返佣状态") page_main['th_num'] = 4 yield self.render("user/swissquote_index_proxy_account_list.html", page_main=page_main, session=self.session) return else: page_main['title_type'] = self.locale.translate("瑞讯银行瑞士账户申请") # page_main['th_num'] = 2 yield self.render('user/swissquote_index.html', page_main=page_main, session=self.session) return else: # 表单错误 from models.public.confrom_model import get_ErrorForm logger.error(get_ErrorForm(F)) self.render('user/500.html') return self.finish()
def post(self): echo_dist = {} echo_dist['data'] = [] echo_dist["recordsTotal"] = 0 echo_dist["recordsFiltered"] = 0 if self.session['swissquote_uid'] == None: # 退出 echo_dist['reponse_status'] = -1 else: # print("SS:", self.request.arguments) F = ProxyForm(self.request.arguments) if F.validate(): #and F.cla.data == "SendError" echo_dist['reponse_status'] = 5 P = ProxyOrderModel() cookie_dist = self.getCookie(1) page_papa = {} page_papa['start'] = F.start.data page_papa['length'] = F.length.data page_papa['search'] = self.get_argument('search[value]', '0') # page_papa['search_regex'] = F.search_regex.data # page_papa['page_num'] = self.get_argument('page_num', 10) page_papa['fx_type'] = F.fx_type.data page_papa['account'] = F.account.data page_papa['time_type'] = F.time_type.data echo_dist['fx_type'] = F.fx_type.data if F.fx_type.data == "list_proposal": echo_dist['data'] = yield P.getCsList( self.session['swissquote_uid'], F.start.data, F.length.data) elif F.fx_type.data == "list_proxy_order": # 单个账户佣金列表 echo_dist['data'] = yield P.getProxyOrderList( self.session['swissquote_uid'], page_papa) elif F.fx_type.data == "list_proxy_count2": # 单个账户返佣总金额 echo_dist['data'] = yield P.getProxyCount2( self.session['swissquote_uid'], page_papa) elif F.fx_type.data == "list_proxy_count": # 返佣总金额 echo_dist['data'] = yield P.getProxyCount( self.session['swissquote_uid'], page_papa) elif F.fx_type.data == "list_proxy_order_count": # 统计各账户的返佣金额 echo_dist['data'] = yield P.getProxyOrderCountList( self.session['swissquote_uid'], page_papa) elif F.fx_type.data == "list_settlement": # 统计返佣结算金额列表 echo_dist['data'] = yield P.getProxySettlementList( self.session['swissquote_uid'], page_papa) elif F.fx_type.data == "list_settlement_count": # 统计结算金额 echo_dist['data'] = yield P.getProxySettlementCount( self.session['swissquote_uid'], page_papa) else: echo_dist['echo'] = self.locale.translate("无数据") echo_dist['reponse_status'] = 5 # print(echo_dist['data']) if len(echo_dist.get('data')) > 0: if 'allnum' in echo_dist['data'][-1]: allnum = echo_dist['data'].pop() # print('allnum', allnum) echo_dist["recordsTotal"] = allnum['allnum'] echo_dist["recordsFiltered"] = allnum['allnum'] # s_data.pop() else: echo_dist['echo'] = self.locale.translate("无数据") echo_dist['reponse_status'] = 5 else: # 表单错误 from models.public.confrom_model import get_ErrorForm echo_dist['echo'] = get_ErrorForm(F) echo_dist['reponse_status'] = 1 # print(echo_dist) from models.public.headers_model import DateEncoder yield self.write(json.dumps(echo_dist, cls=DateEncoder)) # self.write(json.dumps(echo_dist)) self.finish()
def post(self): echo_dist = {} echo_dist['data'] = [] echo_dist["recordsTotal"] = 0 echo_dist["recordsFiltered"] = 0 if self.session['web_uid'] == None: # 退出 echo_dist['reponse_status'] = -1 else: # print("SS:", self.request.arguments) F = ProxyInfoForm(self.request.arguments) if F.validate(): #and F.cla.data == "SendError" echo_dist['reponse_status'] = 5 P = ProxyOrderModel() cookie_dist = self.getCookie(1) if F.fx_type.data == "edit_proxy": # 修改 data = yield P.CheckProxyInfo(self.session['web_uid']) if len(data) > 0: if data[0]['flag'] == 0: m_dist = yield P.set_proxy_info( self.session['web_uid'], F.uname.data, F.iban.data) else: m_dist = yield P.add_proxy_info( self.session['web_uid'], F.uname.data, F.iban.data) if m_dist == True: echo_dist['reponse_status'] = 5 echo_dist['echo'] = self.locale.translate("保存成功!") else: echo_dist['reponse_status'] = -1 echo_dist['echo'] = self.locale.translate("保存失败!") elif F.fx_type.data == "edit_verify": # 修改 Ok_flag = yield P.editPAVerify(self.session['web_uid'], F.account.data, config.PROXY_PRICE) if Ok_flag == 5: echo_dist['reponse_status'] = 5 echo_dist['echo'] = self.locale.translate("返佣激活成功") elif Ok_flag == -1: echo_dist['reponse_status'] = -1 echo_dist['echo'] = self.locale.translate("返佣激活出错") else: echo_dist['reponse_status'] = -2 echo_dist['echo'] = self.locale.translate( "返佣激活失败!请在账户完成首笔交易并平仓后再试") elif F.fx_type.data == "add_proxy_account": # 新增账户 Ok_flag = yield P.addProxyAccount(self.session['web_uid'], F.account.data, F.a_code.data) if Ok_flag == 5: echo_dist['reponse_status'] = 5 echo_dist['echo'] = self.locale.translate("新增成功") elif Ok_flag == -1: echo_dist['reponse_status'] = -1 echo_dist['echo'] = self.locale.translate("新增失败") elif Ok_flag == -2: echo_dist['reponse_status'] = -2 echo_dist['echo'] = self.locale.translate( "新增失败,账户已经绑定过") else: echo_dist['reponse_status'] = -3 echo_dist['echo'] = self.locale.translate( "新增失败,账户验证失败,请检查填写信息的正确性") elif F.fx_type.data == "list_proxy_account": page_papa = {} page_papa['start'] = F.start.data page_papa['length'] = F.length.data page_papa['search'] = self.get_argument( 'search[value]', '0') echo_dist['data'] = yield P.getProxyAccountList( self.session['web_uid'], page_papa) else: echo_dist['echo'] = self.locale.translate("无数据") echo_dist['reponse_status'] = 5 # print(echo_dist['data']) if F.fx_type.data == "list_proxy_account": if len(echo_dist.get('data')) > 0: if 'allnum' in echo_dist['data'][-1]: allnum = echo_dist['data'].pop() # print('allnum', allnum) echo_dist["recordsTotal"] = allnum['allnum'] echo_dist["recordsFiltered"] = allnum['allnum'] # s_data.pop() else: echo_dist['echo'] = self.locale.translate("无数据") echo_dist['reponse_status'] = 5 else: # 表单错误 from models.public.confrom_model import get_ErrorForm echo_dist['echo'] = get_ErrorForm(F) echo_dist['reponse_status'] = 1 # print(echo_dist) from models.public.headers_model import DateEncoder yield self.write(json.dumps(echo_dist, cls=DateEncoder)) # self.write(json.dumps(echo_dist)) self.finish()
def get(self): #self.render("user/login.html", next=self.get_argument("next")) get_class = self.get_argument('class') ukid = self.get_argument('ukid') AccountNumber = self.get_argument('f2') md5_from = self.get_argument('f5') Master_flag = self.get_argument('f6') OrderTicket = self.get_arguments('H0') OpenT = self.get_arguments('H1') OrderComment = self.get_arguments('H2') # print(type(OrderComment)) # for ii in OrderComment: # print(ii) account = self.get_arguments('H3') OrderProfit = self.get_arguments('H4') proxy_from_orderid = self.get_arguments('H5') # 验证 R = RedisClass() uaid = yield R.chick_MD5_uaid(AccountNumber, md5_from, ukid) # print("uaid:", uaid) if uaid > 0: #验证通过 O = ProxyOrderModel() url_text = "2," upnew_flag = 0 #把OrderTicket转成元组 TicketTuple = yield O.FormatTuple(OrderTicket) accountTuple = yield O.FormatTuple(account) Order_datas = yield O.CheckOrderList(uaid, TicketTuple) order_Tuple_add = [] order_Tuple_edit = [] GradePrice = yield O.findProxyGradePrice(accountTuple) # print(GradePrice) for i in range(len(OrderTicket)): edit_flag = 0 for Order_data in Order_datas: if str(OrderTicket[i]) == str(Order_data['orderid']): #存在订单 if OpenT[i] != str(Order_data['stime']): edit_flag = 1 if account[i] != str(Order_data['account']): edit_flag = 1 if OrderProfit[i] != str(Order_data['profit']): edit_flag = 1 if proxy_from_orderid[i] != str(Order_data['proxy_from_orderid']): edit_flag = 1 # print(OrderComment[i]) # print(Order_data['comment']) if OrderComment[i] != str(Order_data['comment']): edit_flag = 1 if Order_data['proxy_profit'] > 0 or str(Order_data['proxy_profit']) != "0.00": edit_flag = 2 if edit_flag == 1: # 修改订单,元组列表 tupleList2 = (int(OpenT[i]), int(proxy_from_orderid[i]), OrderComment[i], int(account[i]), float(OrderProfit[i]), float(OrderProfit[i]) / config.PROXY_PRICE * GradePrice[i], 1, uaid, int(OrderTicket[i])) order_Tuple_edit.append(tupleList2) else: #无须修改的 url_text = url_text + OrderTicket[i] + ",1," edit_flag = 2 break if edit_flag == 0: #增加订单,元组列表 tupleList = (int(OrderTicket[i]), int(proxy_from_orderid[i]), int(account[i]), int(OpenT[i]), float(OrderProfit[i]), float(OrderProfit[i]) / config.PROXY_PRICE * GradePrice[i], OrderComment[i], uaid, 1) order_Tuple_add.append(tupleList) if len(order_Tuple_add) > 0: # 批量增加订单 add_flag = yield O.AddOrderList(order_Tuple_add) if add_flag == True: orderid_str = "" add_edit_flag = 0 for order_1 in order_Tuple_add: url_text = url_text + str(order_1[0]) + ",1," # print("==%s" % type(order_1[18])) else: for order_2 in order_Tuple_add: url_text = url_text + str(order_2[0]) + ",0," if len(order_Tuple_edit) > 0: # 修改订单 up_flag = yield O.UpOrderList(order_Tuple_edit) if up_flag == True: for order_3 in order_Tuple_edit: url_text = url_text + str(order_3[8]) + ",1," upnew_flag = upnew_flag + 1 else: for order_4 in order_Tuple_edit: url_text = url_text + str(order_4[8]) + ",0," else: if uaid == -1: # MD5不相符 url_text = '-1,-1,0,0,0,0,0,0,0,' else: #不存在或是没有登陆 url_text = '-1,-2,0,0,0,0,0,0,0,' # print(url_text) self.write(url_text + config.StringEnd) self.finish() # #整理数据 # if users['ea'] =="true" or users['ea'] == 1: # users['ea'] == 1 # else: # users['ea'] == 0 # if users['moni'] == "true": # users['moni'] == 1 # else: # users['moni'] == 0 # # # md5_str = users['account'] + users['version'] # str_md5 = hashlib.md5(md5_str.encode(encoding='UTF-8')).hexdigest() # # 验证 # #datas = "" # y = UserModel() # if users['md5_from'] == str_md5: # if get_class == "check": # datas = yield y.GetAccount(users)#tornado.gen.Task # # 执行Task函数,内部还是返回future对象。Task函数上第一个参数是要执行的函数,第二个是参数 # # self.write(datas) # else: # self.write('-1,0,0,0,0,0,0,0,0,') # self.finish() #登录成功附加别的属性 # def success_login(self, user): # user.last_login = datetime.now() # user.loginnum += 1 # self.db.add(user) # self.db.commit() # self.session.set('username', user.user_name)
def post(self): echo_dist = {} echo_dist['data'] = [] echo_dist["recordsTotal"] = 0 echo_dist["recordsFiltered"] = 0 if self.session['ManagerUid'] == None: # 退出 echo_dist['reponse_status'] = -1 else: # print("SS:", self.request.arguments) F = ProxyInfoForm(self.request.arguments) if F.validate(): #and F.cla.data == "SendError" echo_dist['reponse_status'] = 5 P = ProxyOrderModel() cookie_dist = self.getCookie(1) if F.fx_type.data == "edit_proxy": # 修改 data = yield P.CheckProxyInfo(self.session['web_uid']) if len(data) > 0: if data[0]['flag'] == 0: m_dist = yield P.set_proxy_info( self.session['web_uid'], F.uname.data, F.iban.data) if m_dist == True: echo_dist['reponse_status'] = 5 echo_dist['echo'] = self.locale.translate("保存成功!") else: echo_dist['reponse_status'] = -1 echo_dist['echo'] = self.locale.translate("保存失败!") elif F.fx_type.data == "edit_u_flag": # 修改,修改状态 Ok_flag = yield P.set_proxy_u_flag(F.uid.data) if Ok_flag == True: echo_dist['reponse_status'] = 5 echo_dist['echo'] = self.locale.translate("修改成功") else: echo_dist['reponse_status'] = -2 echo_dist['echo'] = self.locale.translate("修改出错") elif F.fx_type.data == "edit_grade_price": # 修改佣金 Ok_flag = yield P.set_proxy_grade_price( F.uid.data, F.grade_id.data) if Ok_flag == True: echo_dist['reponse_status'] = 5 echo_dist['echo'] = self.locale.translate("修改成功") else: echo_dist['reponse_status'] = -1 echo_dist['echo'] = self.locale.translate("修改失败") elif F.fx_type.data == "list_proxy": page_papa = {} page_papa['start'] = F.start.data page_papa['length'] = F.length.data page_papa['search'] = self.get_argument( 'search[value]', '0') echo_dist['data'] = yield P.getProxyList(page_papa) elif F.fx_type.data == "list_proxy_account": page_papa = {} page_papa['start'] = F.start.data page_papa['length'] = F.length.data page_papa['search'] = self.get_argument( 'search[value]', '0') echo_dist['data'] = yield P.getProxyAccountList( self.session['web_uid'], page_papa) else: echo_dist['echo'] = self.locale.translate("无数据") echo_dist['reponse_status'] = 5 # print(echo_dist['data']) if F.fx_type.data == "list_proxy": if len(echo_dist.get('data')) > 0: if 'allnum' in echo_dist['data'][-1]: allnum = echo_dist['data'].pop() # print('allnum', allnum) echo_dist["recordsTotal"] = allnum['allnum'] echo_dist["recordsFiltered"] = allnum['allnum'] # s_data.pop() else: echo_dist['echo'] = self.locale.translate("无数据") echo_dist['reponse_status'] = 5 else: # 表单错误 from models.public.confrom_model import get_ErrorForm echo_dist['echo'] = get_ErrorForm(F) echo_dist['reponse_status'] = 1 # print(echo_dist) from models.public.headers_model import DateEncoder yield self.write(json.dumps(echo_dist, cls=DateEncoder)) # self.write(json.dumps(echo_dist)) self.finish()
def get(self): page_main = {} page_main['lang'] = self.get_lang() page_main['title_website'] = config.WEBSITE_NAME if self.session['ManagerUid'] == None: # 退出 # yield self.render("user/login.html", page_main=page_main) yield self.render("admin/login.html", page_main=page_main) return else: F = ProxyInfoForm(self.request.arguments) if F.validate(): # cookie_dist = self.getCookie() # page_main.update(cookie_dist) page_main['prc_type'] = F.fx_type.data P = ProxyOrderModel() if F.fx_type.data == "edit_proxy": # 修改代理资料 data = yield P.CheckProxyInfo(self.session['web_uid']) if len(data) > 0: page_main['uname'] = data[0]['uname'] page_main['iban'] = data[0]['iban'] page_main['flag'] = data[0]['flag'] page_main['title_type'] = self.locale.translate( "修改返佣资料") else: yield P.add_proxy_info(self.session['web_uid']) page_main['uname'] = "" page_main['iban'] = "" page_main['flag'] = 0 page_main['title_type'] = self.locale.translate( "新增返佣资料") yield self.render("user/index_edit_proxy_info.html", page_main=page_main, session=self.session) return elif F.fx_type.data == "list_proxy": # 代理列表 page_main['title_type'] = self.locale.translate("返佣管理") data = yield P.getProxyGradePrice() page_main['price_html'] = yield self.format_html(data) page_main['th_num'] = 5 yield self.render("admin/index_proxy_list.html", page_main=page_main, session=self.session) return elif F.fx_type.data == "list_proxy_account": # 各代理的列表 page_main['title_type'] = self.locale.translate("账户管理") page_main['th_num'] = 4 yield self.render("user/index_proxy_account_list.html", page_main=page_main, session=self.session) return else: page_main['title_type'] = self.locale.translate( "瑞讯银行瑞士账户申请") # page_main['th_num'] = 2 yield self.render('admin/index_swissquote_open.html', page_main=page_main, session=self.session) return else: # 表单错误 from models.public.confrom_model import get_ErrorForm logger.error(get_ErrorForm(F)) self.render('admin/500.html') return self.finish()
def post(self): echo_dist = {} echo_dist['data'] = [] echo_dist["recordsTotal"] = 0 echo_dist["recordsFiltered"] = 0 if self.session['ManagerUid'] == None: # 退出 echo_dist['reponse_status'] = -1 else: # print("SS:", self.request.arguments) F = ProxyForm(self.request.arguments) if F.validate():#and F.cla.data == "SendError" echo_dist['reponse_status'] = 5 P = ProxyOrderModel() cookie_dist = self.getCookie(1) page_papa = {} page_papa['start'] = F.start.data page_papa['length'] = F.length.data page_papa['search'] = self.get_argument('search[value]', '0') # page_papa['search_regex'] = F.search_regex.data # page_papa['page_num'] = self.get_argument('page_num', 10) page_papa['fx_type'] = F.fx_type.data page_papa['account'] = F.account.data page_papa['uid'] = F.uid.data page_papa['time_type'] = F.time_type.data echo_dist['fx_type'] = F.fx_type.data if F.fx_type.data == "list_proxy_order": # 单个账户佣金列表 echo_dist['data'] = yield P.getProxyOrderList(page_papa['uid'], page_papa) elif F.fx_type.data == "list_proxy_count2": # 单个账户返佣总金额 echo_dist['data'] = yield P.getProxyCount2(page_papa['uid'], page_papa) elif F.fx_type.data == "list_proxy_count": # 返佣总金额 echo_dist['data'] = yield P.getProxyCount(page_papa['uid'], page_papa) elif F.fx_type.data == "list_proxy_count_all": # 所有代理返佣总金额 echo_dist['data'] = yield P.getProxyCountAll(page_papa) elif F.fx_type.data == "list_proxy_order_count": # 统计各账户的返佣金额 echo_dist['data'] = yield P.getProxyOrderCountList(page_papa['uid'], page_papa) elif F.fx_type.data == "list_proxy_order_count_all": # 统计各代理的返佣金额 echo_dist['data'] = yield P.getProxyOrderCountListAll(page_papa) elif F.fx_type.data == "list_settlement": # 统计返佣结算金额列表 echo_dist['data'] = yield P.getProxySettlementList(page_papa['uid'], page_papa) elif F.fx_type.data == "list_settlement_count": # 统计结算金额 echo_dist['data'] = yield P.getProxySettlementCount(page_papa['uid'], page_papa) elif F.fx_type.data == "list_proxy_settlement_count": # 统计总佣金和总结算金额 echo_dist['all_proxy_profit'], echo_dist['all_profit'], echo_dist['all_amount'] = yield P.getProxySettlementAllCount(page_papa['uid']) data = yield P.CheckProxyInfo(page_papa['uid']) if len(data) > 0: echo_dist['uname'] = data[0]['uname'] echo_dist['iban'] = data[0]['iban'] echo_dist['flag'] = data[0]['flag'] else: echo_dist['uname'] = "" echo_dist['iban'] = "" echo_dist['flag'] = 0 echo_dist['reponse_status'] = 5 echo_dist['echo'] = "" elif F.fx_type.data == "add_settlement": # 新增结算金额 page_papa['in_uname'] = F.in_uname.data page_papa['in_iban'] = F.in_iban.data page_papa['out_iban'] = F.out_iban.data page_papa['amount'] = F.amount.data page_papa['remarks'] = F.remarks.data add_flag = yield P.addProxySettlement(page_papa['uid'], page_papa) if add_flag == True: sendfalg = yield self.ProxySendMail(page_papa['uid'], page_papa['amount']) if sendfalg == True: echo_dist['reponse_status'] = 5 echo_dist['echo'] = "新增完成,邮件发送成功!" else: echo_dist['reponse_status'] = -2 echo_dist['echo'] = "新增完成,邮件发送失败" else: echo_dist['echo'] = "新增失败" echo_dist['reponse_status'] = -1 else: echo_dist['echo'] = self.locale.translate("无数据") echo_dist['reponse_status'] = 5 # print(echo_dist['data']) if len(echo_dist.get('data')) > 0: if 'allnum' in echo_dist['data'][-1]: allnum = echo_dist['data'].pop() # print('allnum', allnum) echo_dist["recordsTotal"] = allnum['allnum'] echo_dist["recordsFiltered"] = allnum['allnum'] # s_data.pop() else: echo_dist['echo'] = self.locale.translate("无数据") echo_dist['reponse_status'] = 5 else: # 表单错误 from models.public.confrom_model import get_ErrorForm echo_dist['echo'] = get_ErrorForm(F) echo_dist['reponse_status'] = 1 # print(echo_dist) from models.public.headers_model import DateEncoder yield self.write(json.dumps(echo_dist, cls=DateEncoder)) # self.write(json.dumps(echo_dist)) self.finish()