def comment(id): if request.method == 'GET': return render_template('article.html') else: if not check_session(20): return "False, you have commented it in a short period." comment = request.form['comment'] email = request.form['email'] vcode = request.form['vcode'] if Serverdatabase.check_words(comment) and Serverdatabase.check_words( email) and Serverdatabase.check_words(vcode): if session['captcha'] == vcode: time = datetime.now() time = str(time) time = time[0:16] Serverdatabase.insert_comment(id, comment, email, time) info = Serverdatabase.article(id) info1 = Serverdatabase.article1(id) info2 = Serverdatabase.get_article_catalogue_info(id) info3 = Serverdatabase.get_count(id) tool = Tool() return render_template('article.html', info=info, info1=info1, info2=info2, id=id, info3=info3, tool=tool) else: return "Failed. Please enter the correct verification code " else: return "False, Please re-input, you maybe input " \ "inappropriate words include f**k, bitch, md, nmsl, idiot, shit, " \ "freak, foolish, liar, stupid, silly, jerk, prat, insane, rubbish, nonsense."
def title(id): info = Serverdatabase.article(id) info1 = Serverdatabase.article1(id) info2 = Serverdatabase.get_article_catalogue_info(id) info3 = Serverdatabase.get_count(id) tool = Tool() return render_template('article.html', info=info, info1=info1, info2=info2, id=id, info3=info3, tool=tool)