def available_events():
"""Displaying all events that are available, not including the current user's created events."""
pacific = timezone('US/Pacific')
time_now = datetime.now(tz=pacific)
user = User.query.filter_by(user_id=session['id']).first()
# The past is 'less' than the present, and we want to show all future (greater) events.
events = Event.query.filter(Event.is_matched == False, Event.user_id != user.user_id, Event.end_time > time_now).all()
return render_template("find_events.html", events=events)
评论列表
文章目录