def zdb_history(): db = g.db user = g.user loginform = forms.LoginForm() login = log_in(loginform) if login: return redirect(url_for('lobby')) return render_template('zdb_history.html', loginform=loginform, user=user)
def search(): db = g.db loginform = forms.LoginForm() login = log_in(loginform) if login: return redirect(url_for('lobby')) keyword = str(request.values.get('keyword')) finduser = User.query.whoosh_search(keyword).all() findpost = Post.query.whoosh_search(keyword).all() pass
def login_page(): loginform = forms.LoginForm() registform = forms.Register() if request.method == 'POST': form_name = request.form['form-name'] if form_name == 'login': login = log_in(loginform) if login: return redirect(url_for('lobby')) else: registed = register(registform) if registed: return redirect(url_for('lobby')) return render_template('login.html', loginform=loginform, registform=registform)