def index(): friends = User.view_friends(session['username']) if friends: for friends in friends: user = User.find_by_username(friends.friend) seeds = Seed.find_by_user(user._id) return render_template('users/show_activities.html', seeds=seeds, user=user, standard=datetime.timedelta(0)) return render_template('users/no_activities.html')
def update_seeds(): friends = User.view_friends(session['username']) seeds = [] if friends: for friends in friends: user = User.find_by_username(friends.friend) seeds = [s.json() for s in Seed.find_updated_seeds(user._id)] return jsonify({'new_seeds': seeds})
def view_friends(): results = [] friends = User.view_friends(session['username']) for friends in friends: results.append(User.find_by_username(friends.friend)) return render_template('users/view_friends.html', results=results)