09 2020 档案
摘要:生产的代码比较简单: import json from kafka import KafkaProducer from decimal import Decimal import decimal class DecimalEncoder(json.JSONEncoder): def default(
阅读全文
摘要:推荐该文章,亲测可用: https://www.jianshu.com/p/bacc8eb03c4b 推荐使用 yml: version: '3' services: zookeeper: image: wurstmeister/zookeeper ports: - "2182:2181" netw
阅读全文
摘要:步骤: 一般我会先创建一个空的触发起函数,为了第二步先创建触发器,和触发器有关联以后,触发器中的new等关键字才能被编辑器识别,方便编辑触发器函数: create or replace function func_trigger_stock_move_insert() returns trigger
阅读全文
摘要:目前有两种比较推荐的方法: 重写export方法在export方法中将表头及数据造出来,只需要将数据写入列表中即可,推荐使用sql,连表查询比较灵活,需要注意的是表头要和数据一一对应,不然报错: class IncomingValuableGroupViewResource(resources.Mo
阅读全文
摘要:我有这样一个函数:func_report_incoming_detail(int,varchar(33)), 如何使用Python拼接sql 语句 sql = "select func_report_incoming_detail({},{})".format(location_id or 'nul
阅读全文
摘要:
阅读全文
摘要:使用`array_agg() 方法
阅读全文
摘要:import xmlrpclib # ... define HOST, PORT, DB, USER, PASS url = 'http://%s:%d/xmlrpc/common' % (HOST,PORT) sock = xmlrpclib.ServerProxy(url) uid = sock
阅读全文
摘要:-- 注释: /* author:XXXX date: desc: */ -- date 可以设置默认值:date("yyyy-MM-dd HH:mm:ss") --创建临时表: drop table if exists tb__detail2; create t
阅读全文
摘要:
阅读全文
摘要:我的服务搭建完成后就只能进入密码验证界面,密码验证完成后就没有然后了 出现这个问题我首先想到的是nginx 的配置问题,验证了一下,如果不适用nginx代理访问就没有问题,说明我的猜想是正确的. 在网上搜索,查看到别人的配置和我的不一样: 参考配置: https://blog.csdn.net/su
阅读全文
摘要:目前个人觉得比较好的方式还是使用for 循环来获取 location_type_dict = { '193': { 'dg': '东莞分仓' }, '182': { 'yw': '义乌分仓' },} # 可以获取每个键的序号,及键值 for key,value in enumerate(cls.lo
阅读全文
摘要:class A(object): def __init__(self): self.permission_type_dict = {'a': 1, 'b': 2} @property def get_dict(self): return dict(a=1, b=2) def func(self):
阅读全文
摘要:SELECT company_id, string_agg(employee, ', ') FROM mytable GROUP BY company_id;
阅读全文
摘要:官方的github: https://github.com/soimort/you-get 比较知名的视频网址基本上都是可以正常爬取的 但是还是有必要弄懂其原理,毕竟某些小众的视频网站还是得靠自己来实现.
阅读全文
摘要:话不多说,直接上代码吧: from django.db import models from datetime import datetime from django.db import models # from DjangoUeditor.models import UEditorField f
阅读全文
摘要:git创建分支: git checkout -b branchname git 切换分支: git checkout branchname git 删除分支: git branch -d branchname
阅读全文
摘要:切换数据库: select 0 查看所有的键: keys * # 星号为模型 Hgetall 获取哈希值: 返回的结果值键值对,相当于 python 中的字典。
阅读全文