views.py 文件源码

python
阅读 22 收藏 0 点赞 0 评论 0

项目:BackManager 作者: linuxyan 项目源码 文件源码
def customer():
    if request.method == 'POST':
        try:
            customer_id = request.form['customer_id']
            customer_oper = request.form['customer_oper']
            customer = customers.query.filter_by(id=customer_id).first()
            if customer_oper == 'stop_back':
                customer.customers_status = 1
            else:
                customer.customers_status = 0
            db.session.add(customer)
            db.session.commit()
            return u"???????"
        except Exception, e:
            print e
            return u"???????"
    else:
        customer_all = customers.query.all()
        return render_template('customers.html',customers=customer_all)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号