示例#1
0
def details(titleblog):
    if titleblog ==  request.cookies.get('title') and 'user' in session:
        title = request.cookies.get('title')
        totalcomment = Users.allcomments(title)
        comment = Users.querytitlei(title)['comment']
        blogs =  Users.bytitle(title)
        number_title(comment,title)
        return render_template('totalcomment.html', totalcomment=totalcomment,blogs=blogs)
    return redirect(url_for('login'))
示例#2
0
def thumbdown(email,blogtitle,blog_id):
    loginform = LoginForm()
    if  'user' in session and blog_id.__len__() ==  32:
        ids = Users.id_one(blog_id)['_id']
        if utils.email_is_valid(email) == True and blog_id == ids:
            dislikes = Users.querytitlei(blogtitle)['dislikes']
            thdow(int(dislikes),blogtitle,blog_id)
            return render_template("dislikes.html")
        else:
            return redirect(url_for('login'))
    return redirect(url_for('login'))