'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 ...
随机推荐
- 【原创】大叔经验分享(90)linux服务器iowait和负载很高
# top top - 21:21:51 up 207 days, 1:30, 5 users, load average: 0.90, 0.79, 1.62 Tasks: 249 total, 1 ...
- call、apply、bind一直是不求甚解!
一直感觉代码中有call和apply就很高大上(看不懂),但是都草草略过,今天非要弄明白!以前总是死记硬背:call.apply.bind 都是用来修改函数中的this,传参时,call是一个个传参, ...
- Linux MySQL 常见无法启动或启动异常的解决方案
Linux MySQL 常见无法启动或启动异常的解决方案 在 Linux 上自建 MySQL 服务器,经常遇到各种无法启动或启动后异常的问题,本文列举一些常见问题的解决办法. 注意:以下错误日志提示, ...
- Vue命名路由
Vue命名路由 <!DOCTYPE html> <html lang="en"> <head> <meta charset="U ...
- Async await 解析
Async 定义:使异步函数以同步函数的形式书写(Generator函数语法糖) 原理:将Generator函数和自动执行器spawn包装在一个函数里 形式:将Generator函数的*替换成asyn ...
- BP神经网络—java实现
神经网络的结构 神经网络的网络结构由输入层,隐含层,输出层组成.隐含层的个数+输出层的个数=神经网络的层数,也就是说神经网络的层数不包括输入层.下面是一个三层的神经网络,包含了两层隐含层,一个输出层. ...
- Java实现 Cookie的生成与读取
今天学习的时候发现Cookie挺有意思的,就自己网上找点例子,自己敲点代码熟练下,现在就记录下来,分享一下. 什么是cookie?? Cookie 是一小段文本信息,伴随着用户请求和页面在 Web 服 ...
- log:日志处理模块
为了更好的跟踪程序,我们通常都会使用日志,当然在golang中也提供了相应的模块. 基本使用 可以直接通过log来调用格式化输出的方法. package main import "log&q ...
- Vs2017 FrameWork EF Mysql Mvc 三层整合1
1 运行环境 vs2017 Net FromWork 4.6.2 手动版 没有 ado.net 实体数据模型 2 NuGet MySql.Data.Entity 6.10.9, MySq ...
- train loss相关问题
一.train loss 收敛慢,把learning_rate调高 二.train loss不下降: 1.观察数据中是否有异常样本或异常label导致数据读取异常2.调小初始化权重,以便使softma ...