def index():
form = SearchForm()
if form.validate_on_submit():
old_word = session.get('key_word')
old_price = session.get('price')
if old_word == form.key_word.data and \
old_price == form.price.data:
flash('It seems like you searched the same keyword and \
price for the two time!')
session['price'] = form.price.data
session['key_word'] = form.key_word.data
return redirect(url_for('search',
key_word=form.key_word.data,
price=form.price.data, refresh=form.refresh.data))
return render_template('index.html', form=form)
评论列表
文章目录