上一页 1 ··· 6 7 8 9 10 11 12 13 14 ··· 27 下一页
摘要: CBV源码分析 # ModelViewSet继承View(django原生View) # APIView继承了View # 先读View的源码 from django.views import View # urls.py path('books1/', views.Books.as_view()) 阅读全文
posted @ 2020-07-07 00:35 耗油炒白菜 阅读(139) 评论(0) 推荐(0) 编辑
摘要: 推荐一个好用的django方法,用于将model实例转换为dict,命名非常简单粗暴 from django.forms.models import model_to_dictdi = model_to_dict(order, exclude=['create_time', 'update_time 阅读全文
posted @ 2020-07-07 00:27 耗油炒白菜 阅读(1062) 评论(0) 推荐(0) 编辑
摘要: UUID(全称为Universally Unique IDentifier)是128位的全局唯一标识符,通常由32字节的字符串表示。它可以通过MAC地址、时间戳、命名空间、随机数、伪随机数来保证生成ID的时间和空间的唯一性。 UUID主要有五个算法,也就是五种方法来实现: 1、uuid1()——基于 阅读全文
posted @ 2020-07-05 19:28 耗油炒白菜 阅读(601) 评论(0) 推荐(0) 编辑
摘要: 1 用ajax提交一个json格式数据,后端返回返回一个json格式数据,console.log打印出来 urls.py from django.conf.urls import url from django.contrib import admin from app01 import views 阅读全文
posted @ 2020-07-05 12:46 耗油炒白菜 阅读(190) 评论(0) 推荐(0) 编辑
摘要: 思路: # 首先设置一个继承dict的类MysessionDict(用来设置session,例如request.mysession) # 请求来的时候 # 1、生成一个空的MysessionDict对象;request.mysession = MysessionDict() # 2、过滤url,如果 阅读全文
posted @ 2020-07-05 12:40 耗油炒白菜 阅读(238) 评论(0) 推荐(0) 编辑
摘要: 1、链式调用(jq),用python实现链式调用 class Person: def __init__(self,name,age,weight,height): self.name = name self.age = age self.weight = weight self.height = h 阅读全文
posted @ 2020-07-02 23:24 耗油炒白菜 阅读(157) 评论(0) 推荐(0) 编辑
摘要: 1、写一个类,有个name属性,如果name赋值为非字符串,就不让放 class Fun(): def __init__(self,name,age,male): self.name = name self.age = age self.male = male def __setattr__(sel 阅读全文
posted @ 2020-07-01 17:41 耗油炒白菜 阅读(126) 评论(0) 推荐(0) 编辑
摘要: <div class="container-fluid"> <div class="row"> <div class="col-md-8 col-md-offset-2"> <h1 class="text-center">登录</h1> <div class="form-group"> <label 阅读全文
posted @ 2020-07-01 09:14 耗油炒白菜 阅读(220) 评论(0) 推荐(0) 编辑
摘要: 目录 1 Git 1.1 Git 简介 1.2 git 与 svn比较 1.3 git工作流程 1.4 版本库间通信 1.5 git分支管理 1.6 git使用 1.6.1 流程 1.6.2 安装 1.6.3 基础命令 1.6.4 git中的忽略文件 1.6.5 多分支开发 1.7 远程git开发 阅读全文
posted @ 2020-06-30 21:26 耗油炒白菜 阅读(125) 评论(0) 推荐(0) 编辑
摘要: win10配置: 安装 下载完virtualenvwrapper-win,会自动帮你连带下载virtualenv,如果没有,要手动下载 # pip3 install virtualenv # pip3 install virtualenvwrapper-win -i https://pypi.dou 阅读全文
posted @ 2020-06-29 16:10 耗油炒白菜 阅读(473) 评论(0) 推荐(0) 编辑
上一页 1 ··· 6 7 8 9 10 11 12 13 14 ··· 27 下一页