Beispiel #1
0
def new_ad():
    if request.method == 'GET':
        return render_template('new_ad.html', ads=Ad.all())
    elif request.method == 'POST':
        ad = Ad.find(request.form['ad_id'])
        values = (None, request.form['title'], request.form['description'],
                  request.form['price'], request.form['date'],
                  request.form['is_active'], request.form['buyer'], ad)
        Ad(*values).create()

        return redirect('/')
Beispiel #2
0
def get_categories():
    return render_template("categories.html", categories=Ad.all())
Beispiel #3
0
def list_ads():
    return render_template('ads.html', ads=Ad.all())