示例#1
0
文件: views.py 项目: asmcos/blog
def index():
	blog = blogs.all();
	form = BlogsForm();
	if request.method == 'POST':
		flag = form.validate(request.params)
		if flag:
			n = blogs(**form.data);
			n.username = request.user.username
			n.save();
	return {'blog':blog,'form':form}
示例#2
0
def index():
    blog = blogs.all()
    return {'blog':blog}