'builtin_function_or_method' object has no attribute 'translate'
'builtin_function_or_method' object has no attribute 'translate'
首先这个错误的意思是:内建函数或方法对象不能转换成对应的属性。
#错误代码
mould = Mould(id="", model="rf", model_name="决策1",
province_id=1, enabled=1, created_by="Ethan.Yeh",
created_date=time.time)
await mould.save()
#正常代码
mould = Mould(id="", model="rf", model_name="决策1",
province_id=1, enabled=1, created_by="Ethan.Yeh",
created_date=time.time())
await mould.save()
创建时间created_data 赋值的时候给了time.time 这个方法不能解析。正确的赋值应该是time.time()
创建对象的时候没有问题,存储的时候那个created_date 不是时间,而是一个函数什么的。所以报错。
'builtin_function_or_method' object has no attribute 'translate'的更多相关文章
- AttributeError: 'dict_values' object has no attribute 'translate'
/***************************************************************************************** * Attribu ...
- peewee insert 数据时报错:'buffer' object has no attribute 'translate'
错误信息: "'buffer' object has no attribute 'translate'" 场景:使用peewee insert 数据时,BlobField 字段存储 ...
- pymysql下报错:numpy.float64 object has no attribute 'translate' 可能是pandas版本的问题
pymysql下报错:numpy.float64 object has no attribute 'translate'.定位到db.merge函数中,dataframe中浮点型元素的类型为numpy ...
- AttributeError: 'builtin_function_or_method' object has no attribute 'reshape'
AttributeError: 'builtin_function_or_method' object has no attribute 'reshape' 读取.mat文件时,copy没加括号
- 【python问题系列--3】TypeError: 'builtin_function_or_method' object has no attribute '__getitem__'
p0V,p1V,pSpam=trainNBO(array[trainMat],array(trainClasses)) 改为: p0V,p1V,pSpam=trainNBO(array(trainMa ...
- AttributeError: 'dict' object has no attribute 'encode'
首先这是一个很简单的 运行时错误: 错误分析: AttributeError:属性错误,造成这种错误的原因可能有: 你尝试访问一个不存在的属性或方法.检查一下拼写!你可以使用内建函数 dir 来列出存 ...
- Python脚本报错AttributeError: ‘module’ object has no attribute’xxx’解决方法
最近在编写Python脚本过程中遇到一个问题比较奇怪:Python脚本完全正常没问题,但执行总报错"AttributeError: 'module' object has no attrib ...
- AttributeError: 'list' object has no attribute 'write_pdf'
我在可视化决策树,运行以下代码时报错:AttributeError: 'list' object has no attribute 'write_pdf' 我使用的是python3.4 from sk ...
- AttributeError: '_csv.reader' object has no attribute 'next'
我在使用pyhon3.4运行以下代码时报错:AttributeError: '_csv.reader' object has no attribute 'next' import csv import ...
随机推荐
- static的用法详解
一.静态类 [1] 仅包含静态成员. [2] 静态类的本质,是一个抽象的密封类,所以不能被继承,也不能被实例化.也就是说,不能使用 new 关键字创建静态类类型的变量. [4] 不能包含实例构造函数. ...
- 巧用Ajax的beforeSend 提高用户体验--防止重复数据
巧用Ajax的beforeSend 提高用户体验 jQuery是经常使用的一个开源js框架,其中的$.ajax请求中有一个beforeSend方法,用于在向服务器发送请求前执行一些动作.具体可参考jQ ...
- IE浏览器 Table 兼容问题
border篇: 直接在<tr>标签上添加 border-bottom:1px solid red; 在IE8以上浏览器有效,IE7以下版本无效 解决方案:需给<table&g ...
- 远程调用cmd更新本地jar
最近遇到一个项目需求需要实现远程更新,但是本地项目无法更新自己,这让博主很是头疼,既然自己无法更新自己的话,那就自建新的项目,通过本地项目来调用新项目接口来更新本地项目. 代码如下: /** * 重启 ...
- stm32 窗口看门狗 WWDG
窗口看门狗WWDG其实和独立看门狗类似,它是一个7位递减计数器不断的往下递减计数,当减到一个固定值0x40时还不喂狗的话,产生一个MCU复位,这个值叫窗口的下限,是固定的值,不能改变 窗口看门狗(WW ...
- LINUX档案权限
一.ls命令显示目录详细信息 列表显示目录内容 : ls drwxr-xr-x. 4 root root 4096 Jun 26 02:07 acpi -rw-r--r--. 1 ...
- ORACLE 存储过程提高
1.SQLCODE和SQLERRM 2.%TYPE和%ROWTYPE的使用 3.sql%rowcount的作用 1.SQLCODE和SQLERRM SQLCode:数据库操作的返回码,其中 --成功: ...
- Image Processing and Analysis_15_Image Registration: A Method for Registration of 3-D shapes——1992
此主要讨论图像处理与分析.虽然计算机视觉部分的有些内容比如特 征提取等也可以归结到图像分析中来,但鉴于它们与计算机视觉的紧密联系,以 及它们的出处,没有把它们纳入到图像处理与分析中来.同样,这里面也有 ...
- Linux命令——cp、rm、mv、touch、file、dir
cp copy 拷贝文件 拷贝过程不指定目标文件名 则目标文件名和源文件名一样 [root@WebServer ~]# cp /91xueit/teacher.txt 51cto/ 拷贝过程指定目标文 ...
- dl pthread m库的含义
dl:dlopen dlerror dlclose dlsym等函数的库 m:math.h中声明的库函数,比如log10等 pthread:线程建立函数 参考: Linux 编译C程序遇到依赖libm ...