server.py 文件源码

python
阅读 20 收藏 0 点赞 0 评论 0

项目:Fork-Spoon 作者: vivianhoang 项目源码 文件源码
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)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号