当前位置: 首页>>代码示例>>Python>>正文


Python logger.exception函数代码示例

本文整理汇总了Python中scapp.config.logger.exception函数的典型用法代码示例。如果您正苦于以下问题:Python exception函数的具体用法?Python exception怎么用?Python exception使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了exception函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: assets_receivable

def assets_receivable(loan_apply_id):
    '''
    资产负债表-应收账款,预付账款
    账户类型,0:应收账款,1:预付账款
    '''
    if request.method == 'POST':
        result={'result':'success'}
        try:
            sc_assets_receivable( request.form['loan_apply_id'],request.form['accounts_type'],
                            request.form['customer_name'],request.form['describe'],request.form['proportion'],
                            request.form['amount']
            ).add()
            # 事务提交
            db.session.commit()
            # 消息闪现
            #flash('保存成功','Success')
        except:
            # 回滚
            db.session.rollback()
            logger.exception('exception')
            # 消息闪现
            #flash('保存失败','Error')
            result={'result':'fail'}
        finally:
            return json.dumps(result,ensure_ascii=False)
    else :
        data = sc_assets_receivable.query.filter_by(loan_apply_id==loan_apply_id).all()
        encoder.FLOAT_REPR = lambda o: format(o, '.2f')#使float类型字段只显示两位小数
        return json.dumps(data,ensure_ascii=False)
开发者ID:JohnCny,项目名称:xhsc,代码行数:29,代码来源:sc_assets_recervable.py

示例2: change_password

def change_password(id):
    if request.method == 'POST':
        try:
            user = SC_User.query.filter_by(id=id).first()
            if user.login_password == GetStringMD5(request.form['old_password']):
                user.login_password = GetStringMD5(request.form['login_password'])
            else:
                raise Exception

            # 事务提交
            db.session.commit()
            # 消息闪现
            flash('修改密码成功,请重新登录!','success')

        except:
            # 回滚
            db.session.rollback()
            logger.exception('exception')
            # 消息闪现
            flash('修改密码失败,为保障账号安全,请重新登录后再尝试修改!','error')

        logout_user()
        return redirect("login")
    else:
        return render_template("change_password.html")
开发者ID:JohnCny,项目名称:xhsc,代码行数:25,代码来源:index.py

示例3: assets_fixed_assets

def assets_fixed_assets(loan_apply_id):
    '''
    资产负债表-固定资产清单
    '''
    if request.method == 'POST':
        result={'result':'success'}
        try:
            sc_assets_fixed_assets( request.form['loan_apply_id'],request.form['assets_type'],
                                    request.form['assets_name'],request.form['assets_ah'],request.form['describe'],
                                    request.form['assets_date'],request.form['price'],request.form['amount']
            ).add()
            # 事务提交
            db.session.commit()
            # 消息闪现
            #flash('保存成功','Success')
        except:
            # 回滚
            db.session.rollback()
            logger.exception('exception')
            # 消息闪现
            #flash('保存失败','Error')
            result={'result':'fail'}
        finally:
            return json.dumps(result,ensure_ascii=False)
    else :
        data = sc_assets_fixed_assets.query.filter_by(loan_apply_id==loan_apply_id).all()
        encoder.FLOAT_REPR = lambda o: format(o, '.2f')#使float类型字段只显示两位小数
        return json.dumps(data,cls=json_encoding.DateEncoder,ensure_ascii=False)
开发者ID:JohnCny,项目名称:xhsc,代码行数:28,代码来源:sc_assets_fixed_assets.py

示例4: assets_receipts

def assets_receipts(loan_apply_id):
    """
    资产负债表-预收账款
    """
    if request.method == "POST":
        result = {"result": "success"}
        try:
            sc_assets_receipts(
                request.form["loan_apply_id"],
                request.form["source"],
                request.form["occur_date"],
                request.form["describe"],
                request.form["amount"],
            ).add()
            # 事务提交
            db.session.commit()
            # 消息闪现
            # flash('保存成功','Success')
        except:
            # 回滚
            db.session.rollback()
            logger.exception("exception")
            # 消息闪现
            # flash('保存失败','Error')
            result = {"result": "fail"}
        finally:
            return json.dumps(result, ensure_ascii=False)
    else:
        data = sc_assets_receipts.query.filter_by(loan_apply_id == loan_apply_id).all()
        encoder.FLOAT_REPR = lambda o: format(o, ".2f")  # 使float类型字段只显示两位小数
        return json.dumps(data, cls=json_encoding.DateEncoder, ensure_ascii=False)
开发者ID:JohnCny,项目名称:xhsc,代码行数:31,代码来源:sc_assets_receipts.py

示例5: add

 def add(self, request):
     try:
         SC_parameter_configure.query.delete()
         db.session.flush()
         level_base_list = request.form.getlist('level_base')
         level_A1_list = request.form.getlist('level_A1')
         level_A2_list = request.form.getlist('level_A2')
         level_A3_list = request.form.getlist('level_A3')
         level_R_list = request.form.getlist('level_R')
         back_payment = request.form['back_payment']
         performance_a = request.form['performance_a']
         performance_b = request.form['performance_b']
         performance_c = request.form['performance_c']
         level_a = request.form['level_a']
         level_b = request.form['level_b']
         for i in range(len(level_base_list)):
             SC_parameter_configure(i + 1, level_base_list[i], level_A1_list[i], level_A2_list[i],
                                    level_A3_list[i], level_R_list[i], back_payment,performance_a, performance_b, performance_c,
                                    level_a, level_b).add()
         # 事务提交
         db.session.commit()
         # 消息闪现
         flash('保存成功', 'success')
     except:
         # 回滚
         db.session.rollback()
         logger.exception('exception')
         # 消息闪现
         flash('保存失败', 'error')
开发者ID:wangxu2013,项目名称:xhsc,代码行数:29,代码来源:performanceMapper.py

示例6: edit_jggl

def edit_jggl(id):
    if request.method == 'POST':
        try:
            obj = OA_Org.query.filter_by(id=id).first()
            obj.name = request.form['name']
            obj.manager = request.form['manager']
            obj.amount = request.form['amount']
            obj.is_caiwu = request.form['is_caiwu']
            obj.modify_user = current_user.id
            obj.modify_date = datetime.datetime.now()
            
            # 事务提交
            db.session.commit()
            # 消息闪现
            flash('保存成功','success')
        except:
            # 回滚
            db.session.rollback()
            logger.exception('exception')
            # 消息闪现
            flash('保存失败','error')
        
        return redirect('System/jggl')
    else:
        obj = OA_Org.query.filter_by(id=id).first()
        user = OA_User.query.filter("id!=1").all()
        return render_template("System/org/edit_jggl.html",obj=obj,user=user)
开发者ID:wangscript,项目名称:oa-1,代码行数:27,代码来源:jggl.py

示例7: edit_zkqd

def edit_zkqd(id):
	if request.method == 'GET':
		accounts_list = SC_Accounts_List.query.filter_by(id=id).first()
		return render_template("Process/dqdc/edit_zkqd.html",accounts_list=accounts_list)
	else:
		try:
			accounts_list = SC_Accounts_List.query.filter_by(id=id).first()
			accounts_list.name = request.form['name']
			accounts_list.original_price = request.form['original_price']
			accounts_list.occur_date = request.form['occur_date']
			accounts_list.deadline = request.form['deadline']
			accounts_list.present_price = request.form['present_price']
			accounts_list.cooperation_history = request.form['cooperation_history']
			accounts_list.average_period = request.form['average_period']
			accounts_list.trading_frequency = request.form['trading_frequency']
			accounts_list.turnover = request.form['turnover']
			accounts_list.pay_type = request.form['pay_type']
			accounts_list.source = request.form['source']
			accounts_list.other_info = request.form['other_info']

			# 事务提交
			db.session.commit()
			# 消息闪现
			flash('保存成功','success')
		except:
			# 回滚
			db.session.rollback()
			logger.exception('exception')
			# 消息闪现
			flash('保存失败','error')

		return redirect('Process/dqdc/dqdc')
开发者ID:JohnCny,项目名称:xhsc,代码行数:32,代码来源:dqdcXed_zkqd.py

示例8: sc_asset_info

def sc_asset_info(belong_customer_type,belong_customer_value):
	if request.method == 'POST':
		try:
			SC_Asset_Info(request.form['asset_name'],request.form['asset_type'],
				request.form['asset_description'],request.form['asset_position'],request.form['credentials_name'],
				request.form['credentials_no'],request.form['appraisal'],request.form['is_mortgage'],
				request.form['mortgage_amount'],request.form['mortgage_object'],
				belong_customer_type,belong_customer_value).add()

			# 事务提交
			db.session.commit()
            # 消息闪现
			flash('保存成功','success')
		except:
            # 回滚
			db.session.rollback()
			logger.exception('exception')
            # 消息闪现
			flash('保存失败','error')

		return redirect('xxgl')

	else:
		asset_type = SC_Asset_Type.query.order_by("id").all()
		asset_info = SC_Asset_Info.query.filter_by(belong_customer_type=belong_customer_type,
			belong_customer_value=belong_customer_value).order_by("id").all()
		if belong_customer_type == 'Company':
			customer = SC_Company_Customer.query.filter_by(id=belong_customer_value).first()
			return render_template("Information/sc_asset_info.html",customer=customer,asset_type=asset_type,
				asset_info=asset_info)
		else:
			customer = SC_Individual_Customer.query.filter_by(id=belong_customer_value).first()
			return render_template("Information/sc_asset_info.html",customer=customer,asset_type=asset_type,
				asset_info=asset_info)
开发者ID:JohnCny,项目名称:xhsc,代码行数:34,代码来源:khxxgl.py

示例9: sc_financial_affairs

def sc_financial_affairs(belong_customer_type,belong_customer_value):
	if request.method == 'POST':
		try:
			SC_Financial_Affairs(request.form['main_supplier'],request.form['main_client'],
				request.form['total_assets'],request.form['stock'],request.form['accounts'],
				request.form['fixed_assets'],request.form['total_liabilities'],request.form['bank_borrowings'],
				request.form['private_borrowers'],request.form['monthly_sales'],request.form['profit'],
				request.form['other_monthly_income'],belong_customer_type,belong_customer_value).add()
				
			# 事务提交
			db.session.commit()
            # 消息闪现
			flash('保存成功','success')
		except:
            # 回滚
			db.session.rollback()
			logger.exception('exception')
            # 消息闪现
			flash('保存失败','error')

		return redirect('xxgl')

	else:
		financial_affairs = SC_Financial_Affairs.query.filter_by(belong_customer_type=belong_customer_type,
			belong_customer_value=belong_customer_value).order_by("id").first()

		if belong_customer_type == 'Company':
			customer = SC_Company_Customer.query.filter_by(id=belong_customer_value).first()
			return render_template("Information/sc_financial_affairs.html",customer=customer,financial_affairs=financial_affairs)
		else:
			customer = SC_Individual_Customer.query.filter_by(id=belong_customer_value).first()
			return render_template("Information/sc_financial_affairs.html",customer=customer,financial_affairs=financial_affairs)
开发者ID:JohnCny,项目名称:xhsc,代码行数:32,代码来源:khxxgl.py

示例10: sc_dealings

def sc_dealings(belong_customer_type,belong_customer_value):
	if request.method == 'POST':
		try:
			SC_Dealings(request.form['deal_name'],request.form['deal_description'],
				belong_customer_type,belong_customer_value).add()

			# 事务提交
			db.session.commit()
            # 消息闪现
			flash('保存成功','success')
		except:
            # 回滚
			db.session.rollback()
			logger.exception('exception')
            # 消息闪现
			flash('保存失败','error')

		return redirect('xxgl')

	else:
		dealings = SC_Dealings.query.filter_by(belong_customer_type=belong_customer_type,
			belong_customer_value=belong_customer_value).order_by("id").all()
		if belong_customer_type == 'Company':
			customer = SC_Company_Customer.query.filter_by(id=belong_customer_value).first()
			return render_template("Information/sc_dealings.html",customer=customer,dealings=dealings)
		else:
			customer = SC_Individual_Customer.query.filter_by(id=belong_customer_value).first()
			return render_template("Information/sc_dealings.html",customer=customer,dealings=dealings)
开发者ID:JohnCny,项目名称:xhsc,代码行数:28,代码来源:khxxgl.py

示例11: sc_relations

def sc_relations(belong_customer_type,belong_customer_value):
	if request.method == 'POST':
		try:
			SC_Relations(request.form['relation_no'],request.form['relation_name'],
				request.form['relation_type'],request.form['cgbl'],request.form['business_name'],
				request.form['relation_describe'],belong_customer_type,belong_customer_value).add()

			# 事务提交
			db.session.commit()
            # 消息闪现
			flash('保存成功','success')
		except:
            # 回滚
			db.session.rollback()
			logger.exception('exception')
            # 消息闪现
			flash('保存失败','error')

		return redirect('xxgl')

	else:
		if belong_customer_type == 'Company':
			customer = SC_Company_Customer.query.filter_by(id=belong_customer_value).first()
			return render_template("Information/sc_relations.html",customer=customer)
		else:
			customer = SC_Individual_Customer.query.filter_by(id=belong_customer_value).first()
			return render_template("Information/sc_relations.html",customer=customer)
开发者ID:JohnCny,项目名称:xhsc,代码行数:27,代码来源:khxxgl.py

示例12: delete_khxxgl

def delete_khxxgl(type,id):
    loan_apply = SC_Loan_Apply.query.filter_by(belong_customer_type=type,belong_customer_value=id).first()
    if loan_apply is None:
        try:
            if type == "Individual":
                SC_Individual_Customer.query.filter_by(id=id).delete()
            else:
                SC_Company_Customer.query.filter_by(id=id).delete()
            
            SC_Dealings.query.filter_by(belong_customer_type=type,belong_customer_value=id).delete()
            SC_Relations.query.filter_by(belong_customer_type=type,belong_customer_value=id).delete()
            SC_Manage_Info.query.filter_by(belong_customer_type=type,belong_customer_value=id).delete()
            SC_Asset_Info.query.filter_by(belong_customer_type=type,belong_customer_value=id).delete()
            SC_Financial_Affairs.query.filter_by(belong_customer_type=type,belong_customer_value=id).delete()
            SC_Other_Info.query.filter_by(belong_customer_type=type,belong_customer_value=id).delete()
            # 事务提交
            db.session.commit()
            # 消息闪现
            flash('删除成功','success')
        except:
            # 回滚
            db.session.rollback()
            logger.exception('exception')
            # 消息闪现
            flash('删除失败','error')
    else:
        flash('该客户已提交贷款申请,无法删除','error')
        
    return redirect('Information/khxxgl')
开发者ID:JohnCny,项目名称:xhsc,代码行数:29,代码来源:khxxgl.py

示例13: assets_loan

def assets_loan(loan_apply_id):
    '''
    资产负债表-银行贷款,社会集资
    '''
    if request.method == 'POST':
        result={'result':'success'}
        try:
            sc_assets_loan( request.form['loan_apply_id'],request.form['loan_type'],
                                    request.form['loan_org'],request.form['loan_amount'],request.form['loan_date'],
                                    request.form['loan_deadline'],request.form['guarantee'],request.form['banlance']
            ).add()
            # 事务提交
            db.session.commit()
            # 消息闪现
            #flash('保存成功','Success')
        except:
            # 回滚
            db.session.rollback()
            logger.exception('exception')
            # 消息闪现
            #flash('保存失败','Error')
            result={'result':'fail'}
        finally:
            return json.dumps(result,ensure_ascii=False)
    else :
        data = sc_assets_loan.query.filter_by(loan_apply_id==loan_apply_id).all()
        encoder.FLOAT_REPR = lambda o: format(o, '.2f')#使float类型字段只显示两位小数
        return json.dumps(data,cls=json_encoding.DateEncoder,ensure_ascii=False)
开发者ID:JohnCny,项目名称:xhsc,代码行数:28,代码来源:sc_assets_loan.py

示例14: dqdcXed_zcfzb

def dqdcXed_zcfzb(loan_apply_id):
	if request.method == 'GET':
		balance_sheets = SC_Balance_Sheet.query.filter_by(loan_apply_id=loan_apply_id).order_by("id").all()
		count_0 = SC_Balance_Sheet.query.filter_by(loan_apply_id=loan_apply_id,loan_type=0).count()
		count_2 = SC_Balance_Sheet.query.filter_by(loan_apply_id=loan_apply_id,loan_type=2).count()
		count_4 = SC_Balance_Sheet.query.filter_by(loan_apply_id=loan_apply_id,loan_type=4).count()
		count_6 = SC_Balance_Sheet.query.filter_by(loan_apply_id=loan_apply_id,loan_type=6).count()
		count_10 = SC_Balance_Sheet.query.filter_by(loan_apply_id=loan_apply_id,loan_type=10).count()
		count_12 = SC_Balance_Sheet.query.filter_by(loan_apply_id=loan_apply_id,loan_type=12).count()
		return render_template("Process/dqdc/dqdcXed_zcfzb.html",loan_apply_id=loan_apply_id,
			balance_sheets=balance_sheets,count_0=count_0,count_2=count_2,count_4=count_4,count_6=count_6,
			count_10=count_10,count_12=count_12)
	else:
		try:
			SC_Balance_Sheet.query.filter_by(loan_apply_id=loan_apply_id).delete()
			db.session.flush()

			for i in range(34):
				for j in range(len(request.form.getlist('type_%s' % i))):
					SC_Balance_Sheet(loan_apply_id,i,request.form.getlist('name_%s' % i)[j],
						j,request.form.getlist('value_%s' % i)[j]).add()

			# 事务提交
			db.session.commit()
			# 消息闪现
			flash('保存成功','success')
		except:
			# 回滚
			db.session.rollback()
			logger.exception('exception')
			# 消息闪现
			flash('保存失败','error')
			
		return redirect('Process/dqdc/dqdcXed_zcfzb/%d' % loan_apply_id)
开发者ID:JohnCny,项目名称:xhsc,代码行数:34,代码来源:dqdcXed_zcfzb.py

示例15: assets_stock

def assets_stock(loan_apply_id):
    '''
    资产负债表-存货
    '''
    if request.method == 'POST':
        result={'result':'success'}
        try:
            sc_assets_stock( request.form['loan_apply_id'],request.form['stock_type'],
                            request.form['stock_evaluate'],request.form['stock_mobility'],request.form['proportion'],
                            request.form['amount']
            ).add()
            # 事务提交
            db.session.commit()
            # 消息闪现
            #flash('保存成功','Success')
        except:
            # 回滚
            db.session.rollback()
            logger.exception('exception')
            # 消息闪现
            #flash('保存失败','Error')
            result={'result':'fail'}
        finally:
            return json.dumps(result,ensure_ascii=False)
    else :
        data = sc_assets_stock.query.filter_by(loan_apply_id==loan_apply_id).all()
        encoder.FLOAT_REPR = lambda o: format(o, '.2f')#使float类型字段只显示两位小数
        return json.dumps(data,ensure_ascii=False)
开发者ID:JohnCny,项目名称:xhsc,代码行数:28,代码来源:sc_assets_stock.py


注:本文中的scapp.config.logger.exception函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。