'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. sudo pip3找不到命令

    转自: https://blog.csdn.net/Cryhelyxx/article/details/53384004 编辑/etc/sudoers 找到Defaults env_reset, 将其 ...

  2. 如何把Windows主机中的文件拉到centOS虚拟机中

    如何把Windows主机中的文件拉到centOS虚拟机中 2017年02月19日 22:19:12 Ariel_lin2017 阅读数:6023 标签: vmware tools共享文件   之前写了 ...

  3. 3、java基础:抽象类与接口的区别

    抽象类 我们都知道在面向对象的领域一切都是对象,同时所有的对象都是通过类来描述的,但是并不是所有的类都是来描述对象的.如果一个类没有足够的信息来描述一个具体的对象,而需要其他具体的类来支撑它,那么这样 ...

  4. sql语句开启事务

    以下为示例代码: begin tran update 表 where 姓名='A' update 表 where 姓名='B' rollback else commit

  5. jquery操作select下拉框:取值,赋值,删除

    1.jQuery对select的取值 <select id="test"> <option value ="1">测试1</opt ...

  6. hadoop之yarn详解(命令篇)

    本篇主要对yarn命令进行阐述 一.yarn命令概述 [root@lgh ~]# yarn -help Usage: yarn [--config confdir] COMMAND where COM ...

  7. 网络编程基础之TCP编程学习(一)

    网络编程基础了解 socket套接字 socket是一种通讯机制,它包含一整套的调用接口和数据结构的定义,他给应用程序提供了使用如TCP/UDP等网络通讯的手段. linux中的网络编程通过socke ...

  8. OpenCV VideoCapture.get()参数详解

    转自https://blog.csdn.net/u011436429/article/details/80604590 方便查阅

  9. Codeforces 729D Sea Battle(简单思维题)

    http://codeforces.com/contest/738/problem/D https://www.cnblogs.com/flipped/p/6086615.html   原 题意:海战 ...

  10. BZOJ 3308 毒瘤结论 网络流

    结论:在答案集合中的数其质因数最多有两个 且有两个的话一个>n1/2一个<n1/2 这样我们就可以把所有质数筛出来 弄成二分图 左边是<n1/2右边是>n1/2的 所以先把单个 ...