上一页 1 ··· 22 23 24 25 26 27 28 29 30 ··· 34 下一页
摘要: AXIOS 本质上等同于json 传值 1.引用 1 //引入axios 2 import Axios from 'axios' 3 //将axios挂载到 Vue原型上 4 Vue.prototype.$https = Axios 5 6 //设置公共的url 7 Axios.defaults.b 阅读全文
posted @ 2018-12-04 23:02 逆欢 阅读(135) 评论(0) 推荐(0) 编辑
摘要: 1.导入vuex vuex是基于vue 的 1 import Vuex from 'vuex' 2 Vue.use(Vuex); 2.创建store 实例 1 let store = new Vuex.Store({ 2 state:{ 3 count:1 4 }, 5 mutations:{ 6 阅读全文
posted @ 2018-12-04 22:44 逆欢 阅读(144) 评论(0) 推荐(0) 编辑
摘要: 1 cookie session auth cookie概念:针对每一个服务器,保存在客户端浏览器的一个key-value结构数据,可以理解成一个字典结构 cookie语法: obj=HttpResponse() obj=render() obj=redirect() # 设置cookie obj. 阅读全文
posted @ 2018-11-23 20:02 逆欢 阅读(94) 评论(0) 推荐(0) 编辑
摘要: 1.多表操作 添加记录: 针对一对多 book_obj=Book.objects.create(title="python葵花宝典",price=100,publishDate="2012-12-12",publish_id=1) pub_obj=Publish.objects.get(pk=1) 阅读全文
posted @ 2018-11-23 19:46 逆欢 阅读(151) 评论(0) 推荐(0) 编辑
摘要: ORM: class Book(models.Model): title=models.CharFiled(max_length=32) 类 表 # Book app01_book 属性变量 字段 # title title 属性对象 约束 # models.CharFiled(max_length 阅读全文
posted @ 2018-11-23 18:00 逆欢 阅读(116) 评论(0) 推荐(0) 编辑
摘要: 1.web应用 本质是基于socket实现的应用程序 浏览器 服务器 2.http协议:应用层协议 1.基于TCP协议 2.基于请求响应 3.短连接 4.无状态 请求协议 浏览器 >服务器 请求协议 服务器 >浏览器 响应协议 3.请求协议 请求首行 get path?get数据 HTTP/1.1 阅读全文
posted @ 2018-11-22 22:00 逆欢 阅读(95) 评论(0) 推荐(0) 编辑
摘要: 1.views.py 1 from django.db import models 2 3 class Menu(models.Model): 4 title = models.CharField(max_length=32, verbose_name='菜单') 5 icon = models.C 阅读全文
posted @ 2018-11-22 21:41 逆欢 阅读(134) 评论(0) 推荐(0) 编辑
摘要: 1. 复杂版 统计,通过跨表查询和timedate模块过滤找到 1 from django.db.models import Count 2 3 class TongJiView(View): 4 def today(self): 5 import datetime 6 today=datetime 阅读全文
posted @ 2018-11-20 21:58 逆欢 阅读(969) 评论(0) 推荐(0) 编辑
摘要: 复习先知 复杂版 将字段设置联合唯一 1 class ClassStudyRecordView(View): 2 def get(self,request): 3 ClassStudyRecordlist=ClassStudyRecord.objects.all() 4 return render( 阅读全文
posted @ 2018-11-20 21:52 逆欢 阅读(478) 评论(1) 推荐(0) 编辑
摘要: 1.左侧菜单点击显示 就是在点击的时候保留点击的功能 方法。 1.加入新的字段,pid来判断 1 class Permission(models.Model): 2 """ 3 权限表 4 """ 5 title = models.CharField(max_length=32, verbose_n 阅读全文
posted @ 2018-11-18 22:27 逆欢 阅读(406) 评论(0) 推荐(0) 编辑
上一页 1 ··· 22 23 24 25 26 27 28 29 30 ··· 34 下一页