2018年1月5日
摘要: 总结Python+Flask+MysqL的web建设技术过程,标准如下: 这篇文章总结了我这个学期的学习结果:使用Flask框架搭建一个可扩展的小型web service,并在其中加上一些原理的阐述或者链接,并用上一些简单的css,js,html。 一、 Flask & 概览 下面是Flask最简单 阅读全文
posted @ 2018-01-05 11:15 lishanting 阅读(121) 评论(0) 推荐(0) 编辑
  2018年1月3日
摘要: 阅读教材,思考并回答以下问题: 1.DDS和IDDS的组成: DDS(决策支持系统)由决策支持系统的系统结构,人机对话子系统,数据库子系统,模型库子系统,方法库子系统组成。 IDDS(智能决策支持系统)由只能人机接口,问题处理系统,知识库子系统与推理机组成。 2.电子商务系统的结构: 电子商务整体结 阅读全文
posted @ 2018-01-03 14:35 lishanting 阅读(144) 评论(0) 推荐(0) 编辑
  2017年12月22日
摘要: 1.更新User对象,设置对内的_password class User(db.Model): __tablename__ = 'user' _password = db.Column(db.String(200), nullable=False) #内部使用 2.编写对外的password fro 阅读全文
posted @ 2017-12-22 11:38 lishanting 阅读(171) 评论(0) 推荐(0) 编辑
  2017年12月20日
摘要: 准备视图函数search() 修改base.html 中搜索输入框所在的 <form action="{{ url_for('search') }}" method="get"> <input name="q" type="text" placeholder="请输入关键字"> 完成视图函数sear 阅读全文
posted @ 2017-12-20 19:20 lishanting 阅读(111) 评论(0) 推荐(0) 编辑
  2017年12月19日
摘要: 个人中心—视图函数带标签页面参数tag@app.route('/usercenter//')def usercenter(user_id, tag): if tag == ‘1': return render_template('usercenter1.html', **context) 个人中心—导航标签链接增加tag参数全部问答 个人中心—有链接到个人中心页面的url增加ta... 阅读全文
posted @ 2017-12-19 21:22 lishanting 阅读(100) 评论(0) 推荐(0) 编辑
  2017年12月16日
摘要: 新页面userbase.html,用 实现标签页导航。 Home Profile Messages 让userbase.html继承base.html。重写title,head,main块.将上述的样式放在head块,放在main块中.定义新的块user。 {% extends'base.html' %} {% block title %}个人中心{% endblock %} {% b... 阅读全文
posted @ 2017-12-16 18:29 lishanting 阅读(112) 评论(0) 推荐(0) 编辑
  2017年12月13日
摘要: 1.个人中心的页面布局(html文件及相应的样式文件) 2.定义视图函数def usercenter(user_id): 3.向前端页面传递参数 4.页面显示相应数据 发布的全部问答 发布的全部评论 个人信息 5.各个页面链接到个人中心 评论 py 阅读全文
posted @ 2017-12-13 12:52 lishanting 阅读(116) 评论(0) 推荐(0) 编辑
  2017年12月8日
摘要: 定义评论的视图函数@app.route('/comment/',methods=['POST'])def comment():读取前端页面数据,保存到数据库中 @app.route('/comment/',methods=['POST']) def comment(): comment =request.form.get('new_comment') ques_id =r... 阅读全文
posted @ 2017-12-08 15:28 lishanting 阅读(111) 评论(0) 推荐(0) 编辑
  2017年12月7日
摘要: 2.首页标题的标签做带参数的链接。 {{ url_for('detail',question_id = foo.id) }} 建立评论的对象关系映射: class Comment(db.Model): __tablename__='comment' 尝试实现发布评论。 阅读全文
posted @ 2017-12-07 12:27 lishanting 阅读(121) 评论(0) 推荐(0) 编辑
  2017年12月5日
摘要: 首页列表显示全部问答: 将数据库查询结果传递到前端页面 Question.query.all() 前端页面循环显示整个列表。 问答排序 index.html {% extends 'base.html' %} {% block title %}首页{% endblock %} {% block head %} {% endblock %} {% block main ... 阅读全文
posted @ 2017-12-05 18:40 lishanting 阅读(151) 评论(0) 推荐(0) 编辑