'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'的更多相关文章

  1. AttributeError: 'dict_values' object has no attribute 'translate'

    /***************************************************************************************** * Attribu ...

  2. peewee insert 数据时报错:'buffer' object has no attribute 'translate'

    错误信息: "'buffer' object has no attribute 'translate'" 场景:使用peewee insert 数据时,BlobField 字段存储 ...

  3. pymysql下报错:numpy.float64 object has no attribute 'translate' 可能是pandas版本的问题

    pymysql下报错:numpy.float64 object has no attribute 'translate'.定位到db.merge函数中,dataframe中浮点型元素的类型为numpy ...

  4. AttributeError: 'builtin_function_or_method' object has no attribute 'reshape'

    AttributeError: 'builtin_function_or_method' object has no attribute 'reshape' 读取.mat文件时,copy没加括号

  5. 【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 ...

  6. AttributeError: 'dict' object has no attribute 'encode'

    首先这是一个很简单的 运行时错误: 错误分析: AttributeError:属性错误,造成这种错误的原因可能有: 你尝试访问一个不存在的属性或方法.检查一下拼写!你可以使用内建函数 dir 来列出存 ...

  7. Python脚本报错AttributeError: ‘module’ object has no attribute’xxx’解决方法

    最近在编写Python脚本过程中遇到一个问题比较奇怪:Python脚本完全正常没问题,但执行总报错"AttributeError: 'module' object has no attrib ...

  8. AttributeError: 'list' object has no attribute 'write_pdf'

    我在可视化决策树,运行以下代码时报错:AttributeError: 'list' object has no attribute 'write_pdf' 我使用的是python3.4 from sk ...

  9. AttributeError: '_csv.reader' object has no attribute 'next'

    我在使用pyhon3.4运行以下代码时报错:AttributeError: '_csv.reader' object has no attribute 'next' import csv import ...

随机推荐

  1. C# explicit interface implementation(显式接口实现)

    C# explicit interface implementation 某个类要实现两个包含相同方法名的接口, 应该如何实现这两个方法? namespace ExplicitInterfaceImp ...

  2. Linux Centos7配置ftp服务器

    一.安装 1.安装 yum install  -y vsftpd 2.设置开机启动 systemctl enable vsftpd.service 3.启动 systemctl start vsftp ...

  3. vue中用解构赋值的方法引入组件

    在一个组件中引入很多其他组件的时候会显得代码很臃肿,这个时候可以用es6的解构赋值的方法 在components中写入一个index.js文件 在该js文件中导出你想要引入的组件 再接着就可以在该组件 ...

  4. 小白_开始学Scrapy__原理

    整体架构 引擎(Scrapy Engine),用来处理整个系统的数据流处理,触发事务. 调度器(Scheduler),用来接受引擎发过来的请求,压入队列中,并在引擎再次请求的时候返回. 下载器(Dow ...

  5. Win10删除或是不显示快速访问中最近使用文件记录

    Win10删除或不显示快速访问中最近使用文件记录 安装win10系统后,在文件资源管理器的快速访问将默认记录使用和访问了电脑的一些文件,但是有些最近访问文件的历史纪录,并不想让别人看到,所以就想快速删 ...

  6. smart_ptr之shared_ptr

    智能指针的概念 c++11标准和boost都提供了智能指针的功能.智能指针是普通指针的封装,智能指针是一个对象,对象里面包含了原生指针.可以使用智能指针对象的get()方法可获得封装在里面的原生指针. ...

  7. PAT Advanced 1022 Digital Library (30 分)

    A Digital Library contains millions of books, stored according to their titles, authors, key words o ...

  8. tp5.1动态获取器 增加一个不存在的字段

    $list = $this->agent->where($where) ->withAttr('region',function ($value,$data){ $provice_n ...

  9. openpose-opencv 的coco数据多人体姿态估计

    介绍 opencv除了支持常用的物体检测模型和分类模型之外,还支持openpose模型,同样是线下训练和线上调用.这里不做特别多的介绍,先把源代码和数据放出来- 实验模型获取地址:https://gi ...

  10. 快速排序Quick_Sort

    快排——排序中的明星算法,也几乎是必须掌握的算法,这次我们来领略以下快排为何魅力如此之大. 快排主要有两种思路,分别是挖坑法和交换法,这里我们以挖坑法为例来进行介绍,交换法可以参考这篇博文.值得一提的 ...