views.py 文件源码

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

项目:flask-pony 作者: kyzima-spb 项目源码 文件源码
def customer_edit(customer_id):
    try:
        customer = Customer[customer_id]
    except ObjectNotFound:
        abort(404)

    form = CustomerForm(request.form, obj=customer)

    if form.validate_on_submit():
        customer.email = form.email.data
        customer.password = form.password.data
        customer.name = form.name.data
        customer.country = form.country.data
        customer.address = form.address.data
        return redirect(url_for('customer_show', customer_id=customer.id))

    return render_template('customer/edit.html', form=form)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号