Beispiel #1
0
def add():
    if request.method == "GET":
        return render_template("online/add.html", id=uuid.uuid4().__str__())
    form = request.form
    online = Online()
    online.id = form.get("id")
    session = DBSession()
    session.add(Online)
    session.commit()
    session.close()
    flash("添加成功!")
    return render_template("online/add.html")
Beispiel #2
0
def add():
    if request.method == 'GET':
        articlelist = ArticleType.getlist()
        return render_template('blogs/add.html',id= uuid.uuid4().__str__(),articlelist=articlelist)
    form = request.form
    blogs = Blogs()
    blogs.title = form.get('title')
    blogs.content = form.get('content')
    blogs.synopsis = form.get('synopsis')
    blogs.classify = form.get('classify')
    blogs.state = form.get('state')
    blogs.user_id = g.user.id
    session = DBSession()
    session.add(blogs)
    session.commit()
    session.close()
    flash('添加成功!')
    return render_template('blogs/add.html')
Beispiel #3
0
def add():
    if request.method == 'GET':
        return render_template('merchant/add.html')
    #merchant  = addMerchantFrom()
    form = request.form
    merchant = Merchant()
    print merchant.id
    merchant.name = form.get('name')
    merchant.link_name = form.get('link_name')
    merchant.address = form.get('address')
    merchant.mobile = form.get('mobile')
    merchant.qq = form.get('qq')
    merchant.we_chat = form.get('we_chat')
    merchant.mail = form.get('mail')
    session = DBSession()
    state = session.add(merchant)
    session.commit()
    session.close()
    #print merchant.id
    retult=None
    flash('添加成功!')
    return render_template('merchant/add.html',retult=retult)