摘要: 1. search - 用于过滤事件 [search ... ] # 在默认情况下,所有搜索都隐含了 search 命令 2. index - 用于指定搜索的索引 index = "xxx" # 如果不指定索引,Splunk 会在所有可访问的索引中搜索 3. | - 管道符:将一个命令的输出作为另一 阅读全文
posted @ 2024-05-14 16:01 wellplayed 阅读(697) 评论(0) 推荐(0) 编辑
摘要: 基本组件的使用 -restful规范 -序列化组件 -APIView源码分析 -Response源码分析 -source用法 -定制字段的两种方式 -反序列化的保存与修改 -ModelSerializer用法 -请求与响应 -状态码 -GenericAPIView用法 -路由组件 -认证组件 -权限 阅读全文
posted @ 2023-11-20 21:03 wellplayed 阅读(21) 评论(1) 推荐(2) 编辑
摘要: 一. 正常函数版本的思路 1. notify.py def wechat(content): print('微信通知:%s'%content) def qq(content): print('qq通知:%s'%content) def email(content): print('邮箱通知:%s'% 阅读全文
posted @ 2023-10-29 21:24 wellplayed 阅读(15) 评论(0) 推荐(2) 编辑
摘要: 假设我们有需要导出成excel的数据列表cut_list cut_list = [ {'name':'boy', 'age':18, 'hobby_list':['吃', '喝']}, {'name':'girl', 'age':22, 'hobby_list':['玩', '乐']} ] 确保安装 阅读全文
posted @ 2025-02-06 13:56 wellplayed 阅读(2) 评论(0) 推荐(0) 编辑
摘要: 导入依赖 from celery import chain from .task import 任务1,任务2 # 创建任务链 task_chain = chain( 任务1.si(传入的参数), 任务2.si(XXX) ) # 调用任务链,实现先执行任务1,再执行任务2 task_chain.de 阅读全文
posted @ 2024-12-23 14:37 wellplayed 阅读(48) 评论(0) 推荐(0) 编辑
摘要: 下面的示例主要运用于代码层面的去重处理,不在数据库层面增加唯一键 # 导入依赖 from django.db import models from django.utils.translation import gettext_lazy as _ from rest_framework.except 阅读全文
posted @ 2024-12-23 14:20 wellplayed 阅读(6) 评论(0) 推荐(0) 编辑
摘要: 如果书写了多个信号,可能会出现互相干扰的情况。为了防止这种情况的发生,我们可以手动控制信号的断开与连接。 # 导入依赖 from django.db.models.signals import post_save from django.dispatch import receiver def di 阅读全文
posted @ 2024-12-23 11:00 wellplayed 阅读(7) 评论(0) 推荐(0) 编辑
摘要: 将序列化后的数据导出成excel格式 # 导入依赖 import io from openpyxl import Workbook # 将格式化的数据导出为excel的方法 def output_excel(data): # 创建Excel工作簿 wb = Workbook() ws = wb.ac 阅读全文
posted @ 2024-12-20 11:19 wellplayed 阅读(41) 评论(0) 推荐(0) 编辑
摘要: 表头列合并 // 需要合并的colSpan配置为合并总列数,其余被合并的列colSpan配置为0即可 { title: 'XXX', dataIndex: 'first_name', width: 80, key: 'first_name', fixed: 'left', colSpan: 2 }, 阅读全文
posted @ 2024-12-17 16:39 wellplayed 阅读(64) 评论(0) 推荐(0) 编辑
摘要: Vuex 简介 Vuex 是 Vue.js 官方的状态管理库,帮助我们在中大型应用中集中管理组件间的共享状态。它通过 state、getters、mutations 和 actions 实现响应式数据管理 Vuex 核心概念 State: 全局状态,存储应用的核心数据。 Getters: 类似于组件 阅读全文
posted @ 2024-10-15 13:50 wellplayed 阅读(674) 评论(0) 推荐(0) 编辑
摘要: 先看一个现象: # host/signals.py @receiver(m2m_changed, sender=Vm.products.through) def on_m2m_changed(sender, instance, action, pk_set, **kwargs): do someth 阅读全文
posted @ 2024-09-25 17:34 wellplayed 阅读(14) 评论(0) 推荐(0) 编辑
摘要: 首先需要安装必备的包 pip install celery django-celery-beat 在app中注册 INSTALLED_APPS = [ # ... 'django_celery_beat', ] 创建celery.py并配置 # project/celery.py import os 阅读全文
posted @ 2024-07-12 13:59 wellplayed 阅读(40) 评论(0) 推荐(0) 编辑
摘要: 首先创建一个signals.py文件 # 假设有一个博客应用程序,每当有新文章发表时,给订阅用户发送一封邮件通知 from django.db.models.signals import post_save from django.dispatch import receiver from djan 阅读全文
posted @ 2024-07-09 14:12 wellplayed 阅读(8) 评论(0) 推荐(0) 编辑
点击右上角即可分享
微信分享提示