def newsfeed_data(): if request.method == 'POST': num = request.form['num'] wall_id = session['wall_id'] user_id = session['user_id'] list = [user_id] my_followers = user_manager.get_user_by(user_id).followers.all() for follower in my_followers: list.append(follower.id) news_posts = post_manager.get_news_posts(list, num) return render_template('newsfeed_ajax.html', news_posts = news_posts)
def profile(): user = user_manager.get_user_by(session['user_id']) return render_template('profile.html', profile_image = user.profile_image)
def follow(): my_followees = user_manager.get_user_by(session['user_id']).followees.all() my_followers = user_manager.get_user_by(session['user_id']).followers.all() return render_template('follow.html', my_followees = my_followees, my_followers = my_followers)