摘要: 1 selenium的使用 1.0 基本使用 from selenium import webdriverimport time​# 浏览器对象bro = webdriver.Chrome(executable_path='chromedriver.exe')bro.implicitly_wait( 阅读全文
posted @ 2021-08-10 15:01 代码歌 阅读(539) 评论(0) 推荐(0)
摘要: 基本概念 Python 中的包,即包含 __init__.py 文件的文件夹。 对于 Python 的包内导入,即包内模块导入包内模块,存在绝对导入和相对导入问题。 普通 Python 模块的搜索路径 1. 在当前模块所在路径中搜索导入模块 2. 在环境变量 PYTHONPATH 指定的路径列表中搜 阅读全文
posted @ 2021-07-30 20:58 代码歌 阅读(452) 评论(0) 推荐(0)
摘要: 对于每个具有choices 的字段,每个对象将具有一个get_xx_display() 方法,其中xx 为该字段的名称。 这个方法返回该字段对“人类可读”的值。 像这样: # models.pyclass Person(models.Model): SHIRT_SIZES = ( ('S', 'Sm 阅读全文
posted @ 2021-07-30 11:53 代码歌 阅读(1102) 评论(0) 推荐(0)
摘要: day85 Vue(5) 1 与后端交互的几种方式 1.1 发送axios请求 # 一种是重写_this = this, 使用一个变量代替this 的用法,因为this在function函数中指代的是当前函数,而不是当前对象​<script src="https://unpkg.com/axios/ 阅读全文
posted @ 2021-07-15 19:01 代码歌 阅读(411) 评论(0) 推荐(0)
摘要: day84 Vue (4) 1 按键修饰符 1. @keyup="函数名" # 在键盘按的按键可以展示出来​2. @keyup.enter="函数名" # 按下回车键时会触发相关操作 3. <button @click="handelClick">点我</button>​ methods: { ha 阅读全文
posted @ 2021-07-14 18:58 代码歌 阅读(50) 评论(0) 推荐(0)
摘要: # enumerate() 函数用于将一个可遍历的数据对象(如列表、元组或字符串)组合为一个索引序列,# 同时列出数据和数据下标,一般用在 for 循环当中。# 5、for+enumerate1.ll = [111, 222, 33, 444, 555]for i, v in enumerate(l 阅读全文
posted @ 2021-07-14 14:36 代码歌 阅读(296) 评论(0) 推荐(0)
摘要: Vue基本属性 1.class 与 style 的使用 <style> .box_red{ background: red; height: 100px; } .box_blue{ background: blue; height: 100px; } .font_size{ font-size: 4 阅读全文
posted @ 2021-07-13 20:23 代码歌 阅读(248) 评论(0) 推荐(0)
摘要: vue 1 渐进式框架2 vue 版本:最新3.x,主流用2.x3 第三方:vue-cookie,vue-router,vuex:状态管理器​4 M-V-VM思想:数据的双向绑定(*****)Model :vue对象的data属性里面的数据,这里的数据要显示到页面中View :vue中数据要显示的H 阅读全文
posted @ 2021-07-12 18:59 代码歌 阅读(135) 评论(0) 推荐(0)
摘要: drf分页器 from rest_framework.pagination import PageNumberPagination, LimitOffsetPagination, CursorPagination# 写一个类,继承drf 提供的3个内置分页器类(PageNumberPaginatio 阅读全文
posted @ 2021-07-07 19:34 代码歌 阅读(151) 评论(0) 推荐(0)
摘要: ModelSerializer序列化与反序列化(重点) 视图类 视图类 # 单查群查class UserV3APIView(APIView): # 单查群查 def get(self, request, *args, **kwargs): pk = kwargs.get('pk') if pk: u 阅读全文
posted @ 2021-07-07 17:29 代码歌 阅读(219) 评论(0) 推荐(0)