摘要: 1. 个人学期总结 第一次接触Python,在不了解Python的情况下,基础又差,望而生畏,一开始就给自己打了个叉。然而,通过前期turtle库的学习,我发现这门语言似乎很有趣,用其他语言要写好几十行的代码,用Python语言只要十几二十行的代码就能实现,它的turtle库很简单地用一些条件、循环 阅读全文
posted @ 2018-01-06 16:18 阿植 阅读(1637) 评论(0) 推荐(0) 编辑
摘要: 阅读教材,思考并回答以下问题: 1. DDS和IDDS的组成。 答:DDS(决策支持系统)由决策支持系统的系统结构,人机对话子系统,数据库子系统,模型库子系统,方法库子系统组成。数据部分是一个数据库系统;模型部分包括模型库(MB)及其管理系统(MBMS);推理部分由知识库(KB)、知识库管理系统(K 阅读全文
posted @ 2018-01-04 14:47 阿植 阅读(226) 评论(0) 推荐(0) 编辑
摘要: 模型分离--让代码更方便管理 新建models.py,将模型定义全部放到这个独立的文件中。 新建exts.py,将db = SQLAlchemy()的定义放到这个独立的文件中。 models.py和主py文件,都从exts.py中导入db。 在主py文件中,对db进行始化,db.init_app(a 阅读全文
posted @ 2017-12-26 11:24 阿植 阅读(163) 评论(0) 推荐(0) 编辑
摘要: 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:29 阿植 阅读(174) 评论(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 16:33 阿植 阅读(152) 评论(0) 推荐(0) 编辑
摘要: detail.html 首页 阅读全文
posted @ 2017-12-19 17:12 阿植 阅读(184) 评论(0) 推荐(0) 编辑
摘要: 新页面userbase.html,用 实现标签页导航。 Home Profile Messages 让userbase.html继承base.html。重写title,head,main块.将上述的样式放在head块,放在main块中.定义新的块user。 {% extends 'base.html' %} {% block title %} {% endblock %} {% blo... 阅读全文
posted @ 2017-12-16 21:56 阿植 阅读(193) 评论(0) 推荐(0) 编辑
摘要: 显示所有评论{% for foo in ques.comments %} 所有评论排序uquestion = db.relationship('Question', backref=db.backref('comments', order_by=creat_time.desc)) 显示评论条数{{ 阅读全文
posted @ 2017-12-13 20:48 阿植 阅读(366) 评论(0) 推荐(0) 编辑
摘要: 定义评论的视图函数@app.route('/comment/',methods=['POST'])def comment():读取前端页面数据,保存到数据库中 @app.route('/comment/', methods=['POST']) @log def comment(): comment= 阅读全文
posted @ 2017-12-08 21:26 阿植 阅读(147) 评论(0) 推荐(0) 编辑
摘要: 建立评论的对象关系映射: class Comment(db.Model): __tablename__='comment' 尝试实现发布评论。 阅读全文
posted @ 2017-12-07 11:51 阿植 阅读(221) 评论(0) 推荐(0) 编辑