def list_notes(): ''' 查询博文列表 ''' # 渲染博文列表页面目标文件,传入blogs参数 return render_template('list_blogs.html', blogs=blogs)
def query_note(id): blog = None # 到数据库查询博文详情 for blg in blogs: if blg.id == int(id): blog = blg # 渲染博文详情页面 return render_template('query_blog.html', blog=blog)
def query_note(id): ''' 查询博文详情、删除博文 :param id: :return: ''' blog = None # 到数据库中查询博文详情 for blg in blogs: if blg.id == int(id): blog = blg return render_template('query_blog.html',blog = blog)
def home(): """ 主页 """ return render_template('home.html')
def blog1(id): blog = None for blg in blogs: if blg.id == int(id): blog = blg return render_template('query_blog.html', blog = blog)
def blogs1(): return render_template('list_blogs.html',blogs = blogs)
def home(): return render_template('home.html')
def home(): ''' 主页 ''' # 渲染首页HTML模板文件 return render_template('home.html')
def list_notes(): return render_template('list_blogs.html', blogs=blogs)
def home(): return render_template('index.html')