server.py 文件源码

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

项目:FreeFoodCalendar 作者: Yuliang-Zou 项目源码 文件源码
def index(year):
    conn = pymongo.MongoClient()
    db = conn.test
    cal = Calendar(0)
    try:
        if not year:
            year = date.today().year
        cal_list = [cal.monthdatescalendar(year, i+1) for i in xrange(12)]  
    except Exception, e:
        abort(404)
    else:
        records = [record for record in db.myCollections.find()]
        return render_template('cal.html', year=year, cal=cal_list, 
                               events=records, cur_month=datetime.datetime.now().month)
    abort(404)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号