示例#1
0
文件: views.py 项目: asmcos/cpython
def new():
    form = ApplyForm()
		
    if request.method == 'GET':
		all_course = course.filter(course.c.status == True)
    		return {'form':form,'all_course':all_course}
    elif request.method == 'POST':
		flag = form.validate(request.params)
		if flag:
			n = Apply(**form.data)
			n.save()
			response.template = "new_ok.html"
			return {"id":n.id} 
		else:
    			return {"form":form}
示例#2
0
文件: views.py 项目: asmcos/cpython
def showcourses():
	all = course.filter(course.c.status == True)
	return {'all':all}
示例#3
0
文件: views.py 项目: asmcos/cpython
def showcourse(id):
	c1 = course.filter(course.c.status == True).filter(course.c.id == id)
	return {'c1':c1}