예제 #1
0
def unstar(id):
    post = Post.query.get_or_404(id)
    if not current_user.staring(post):
        flash('你没有收藏这边文章,不能取消收藏')
        return redirect(url_for('.post', id=post.id))
    current_user.unstar(post)
    flash('取消收藏成功')
    return redirect(url_for('.post', id=post.id))
예제 #2
0
def deletestar(id):
    post = Post.query.get_or_404(id)
    if not current_user.staring(post):
        flash('你没有收藏这篇文章')
        return redirect(url_for('.starposts', username=current_user.username))
    current_user.unstar(post)
    flash('你不再收藏这篇旷世奇文了,太可惜了,你与大牛失之交臂')
    return redirect(url_for('.starposts', username=current_user.username))
예제 #3
0
파일: views.py 프로젝트: huihui7987/blog-1
def deletestar(id):
    post=Post.query.get_or_404(id)
    if not current_user.staring(post):
        flash('你没有收藏这篇文章')
        return redirect(url_for('.starposts',username=current_user.username))
    current_user.unstar(post)
    flash('你不再收藏这篇旷世奇文了,太可惜了,你与大牛失之交臂')
    return redirect(url_for('.starposts',username=current_user.username))
예제 #4
0
def unstar(id):
    post = Post.query.get_or_404(id)
    if not current_user.staring(post):
        flash('你没有收藏这篇文章')
        return redirect(url_for('.post', id=post.id))
    current_user.unstar(post)
    flash('你不再收藏这篇旷世奇文了,太可惜了,你与大牛失之交臂')
    return redirect(url_for('.post', id=post.id))
예제 #5
0
파일: views.py 프로젝트: huihui7987/blog-1
def unstar(id):
    post=Post.query.get_or_404(id)
    if not current_user.staring(post):
        flash('你没有收藏这篇文章')
        return redirect(url_for('.post',id=post.id))
    current_user.unstar(post)
    flash('你不再收藏这篇旷世奇文了,太可惜了,你与大牛失之交臂')
    return redirect(url_for('.post',id=post.id))