12 2017 档案

摘要:1.更新User对象,设置对内的_password class User(db.Model): __tablename__ = 'user' _password = db.Column(db.String(200), nullable=False) #内部使用 2.编写对外的password fro 阅读全文
posted @ 2017-12-22 21:47 042冯耀娴 阅读(114) 评论(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-19 19:25 042冯耀娴 阅读(107) 评论(0) 推荐(0) 编辑
摘要:个人中心—视图函数带标签页面参数tag@app.route('/usercenter//')def usercenter(user_id, tag): if tag == ‘1': return render_template('usercenter1.html', **context) @app.route('/usercenter//') @loginFirst def u... 阅读全文
posted @ 2017-12-15 18:08 042冯耀娴 阅读(105) 评论(0) 推荐(0) 编辑
摘要:新页面user.html,用 实现标签页导航。 Home Profile Messages question comments infomation user.html继承base.html。重写title,head,main块.将上述放在main块中.定义新的块user。 {% extends 't... 阅读全文
posted @ 2017-12-14 21:01 042冯耀娴 阅读(102) 评论(0) 推荐(0) 编辑
摘要:1.个人中心的页面布局(html文件及相应的样式文件) 2.定义视图函数def usercenter(user_id): 3.向前端页面传递参数 4.页面显示相应数据 发布的全部问答 发布的全部评论 个人信息 5.各个页面链接到个人中心 阅读全文
posted @ 2017-12-12 18:58 042冯耀娴 阅读(134) 评论(0) 推荐(0) 编辑
摘要:定义评论的视图函数@app.route('/comment/',methods=['POST'])def comment(): @app.route('/comment/',methods=['POST']) @loginFirst def comment(): comment=request.fo 阅读全文
posted @ 2017-12-08 16:03 042冯耀娴 阅读(105) 评论(0) 推荐(0) 编辑
摘要:主PY文件写视图函数,带id参数。 建立评论的对象关系映射: class Comment(db.Model): __tablename__='comment' 尝试实现发布评论。 阅读全文
posted @ 2017-12-05 22:58 042冯耀娴 阅读(125) 评论(0) 推荐(0) 编辑
摘要:首页列表显示全部问答: 将数据库查询结果传递到前端页面 Question.query.all() 前端页面循环显示整个列表。 问答排序 @app.route('/') def index(): context={ 'questions': Question.query.order_by('-creat_time').all() } return rend... 阅读全文
posted @ 2017-12-02 16:45 042冯耀娴 阅读(88) 评论(0) 推荐(0) 编辑