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))
评论列表
文章目录