views.py 文件源码

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

项目:automated-reporting 作者: Waikato 项目源码 文件源码
def index(request):
    # get all schools
    cursor = connection.cursor()
    cursor.execute("""
        SELECT DISTINCT(owning_school_clevel)
        FROM %s
        ORDER BY owning_school_clevel ASC
        """ % GradeResults._meta.db_table)
    schools = list()
    for row in cursor.fetchall():
        schools.append(row[0])
    # configure template
    template = loader.get_template('leave/index.html')
    context = applist.template_context('leave')
    context['schools'] = schools
    context['minimum'] = MINIMUM_DAYS
    return HttpResponse(template.render(context, request))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号