摘要: 1.解压下载的压缩包: 2.将js,swf、xml和png文件导入项目中: 导入后的文件目录: 3、引入文件: 阅读全文
posted @ 2018-10-17 20:28 fangsheng420 阅读(504) 评论(0) 推荐(0) 编辑
摘要: 点击课程标签,去除该课程: 阅读全文
posted @ 2018-10-13 16:15 fangsheng420 阅读(1395) 评论(0) 推荐(0) 编辑
摘要: window.open是用来打开一个新窗口的;window.opener是调用父级窗口 举个栗子: 1.index.html页面: 2. /addBook 所跳转的页面 addbook.html 3. views.py 提交所执行的后台代码: 4.pop.html页面:相当于 信息传递的载体<!DO 阅读全文
posted @ 2018-10-11 17:19 fangsheng420 阅读(2153) 评论(0) 推荐(0) 编辑
摘要: dict是字典对象,没有urlencode()方法; QueryDict对象,有urlencode()方法,作用是将QueryDict对象转换为url字符串; 一般QueryDict通过params = copy.deepcopy(request.GET)得到的,这时params是QueryDict 阅读全文
posted @ 2018-10-10 20:57 fangsheng420 阅读(1185) 评论(0) 推荐(0) 编辑
摘要: 1、首先要下载BeautifulSoup: pip3 install BeautifulSoup4 2、 from bs4 import BeautifulSoups = '''<html><head><title>The Dormouse's story</title></head><body>< 阅读全文
posted @ 2018-10-08 20:12 fangsheng420 阅读(162) 评论(0) 推荐(0) 编辑
摘要: #########################聚合#################################查询所有书籍的价格和 字典ret = Book.objects.all().aggregate(price_sum=Sum("price"))print(ret) # 查询所有作者 阅读全文
posted @ 2018-10-06 17:26 fangsheng420 阅读(153) 评论(0) 推荐(0) 编辑
摘要: #########################基于对象查询(子查询)############################ 按字段(publish) 1) 一对多 : book > publish < book_set.all() 正向查询按字段:查询python这本书籍的出版社的邮箱 pyt 阅读全文
posted @ 2018-10-06 14:37 fangsheng420 阅读(90) 评论(0) 推荐(0) 编辑