12 2017 档案

摘要:个人中心—视图函数带标签页面参数tag@app.route('/usercenter/<user_id>/<tag>')def usercenter(user_id, tag): if tag == ‘1': return render_template('usercenter1.html', ** 阅读全文
posted @ 2017-12-20 17:08 李海力学编程 阅读(179) 评论(0) 推荐(0)
摘要:示例: Lobby.query.filter( or_( and_( Lobby.id == Team.lobby_id, LobbyPlayer.team_id == Team.id, LobbyPlayer.player_id == player.steamid ), and_( Lobby.i 阅读全文
posted @ 2017-12-20 17:04 李海力学编程 阅读(220) 评论(0) 推荐(0)
摘要:新页面userbase.html,用 实现标签页导航。 Home Profile Messages 让userbase.html继承base.html。重写title,head,main块.将上述的样式放在head块,放在main块中.定义新的块user。 让上次作业完成的个人中心页面,继承userbase.html,原个人中心就自动有了标签页导航。 制作个人中心的三个子页面,重写user... 阅读全文
posted @ 2017-12-16 20:52 李海力学编程 阅读(191) 评论(0) 推荐(0)
摘要:1.个人中心的页面布局(html文件及相应的样式文件) 2.定义视图函数def usercenter(user_id): 3.向前端页面传递参数 4.页面显示相应数据 发布的全部问答 发布的全部评论 个人信息 5.各个页面链接到个人中心 阅读全文
posted @ 2017-12-13 21:29 李海力学编程 阅读(263) 评论(0) 推荐(0)
摘要:1.主PY文件写视图函数,带id参数。 @app.route('/detail/<question_id>')def detail(question_id): quest = return render_template('detail.html', ques = quest) 2.首页标题的标签做 阅读全文
posted @ 2017-12-07 18:31 李海力学编程 阅读(253) 评论(0) 推荐(0)
摘要:首页列表显示全部问答: 将数据库查询结果传递到前端页面 Question.query.all() 前端页面循环显示整个列表。 问答排序 完成问答详情页布局: 包含问答的全部信息 评论区 以往评论列表显示区。 在首页点击问答标题,链接到相应详情页。 @app.route('/base2') def b 阅读全文
posted @ 2017-12-05 19:46 李海力学编程 阅读(220) 评论(0) 推荐(0)
摘要:在首页添加显示问答的列表,并定义好相应的样式。 无序列表 <ul > <li>Coffee</li> <li>Tea</li> <li>Milk</li> </ul> 用字典向index.html传递参数。 2. 用字典向index.html传递参数。 阅读全文
posted @ 2017-12-02 20:56 李海力学编程 阅读(190) 评论(0) 推荐(0)