Exemplo n.º 1
0
Arquivo: views.py Projeto: zt8989/bihu
def user(username):
    user = User.query.filter_by(username=username).first()
    if user is None:
        abort(404)
    posts=user.posts
    timelineViews = PostView.toTimelineView(*posts)
    return render_template('user.html', user=user,timelines=timelineViews)
Exemplo n.º 2
0
Arquivo: views.py Projeto: zt8989/bihu
def index():
    if current_user.is_authenticated():
        posts = current_user.followed_posts
        timelineViews = PostView.toTimelineView(*posts)
        return render_template('timeline.html', timelines=timelineViews)
    else:
        return redirect(url_for('.explore'))
Exemplo n.º 3
0
Arquivo: views.py Projeto: zt8989/bihu
def explore():
    posts = Post.query.order_by(Post.timestamp.desc()).limit(20)
    return render_template('explore.html',posts=PostView.toTimelineView(*posts))