'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. python 练习:函数1

    习题: 定义一个方法 func,该func可以引入任意多的整型参数,结果返回其中最大与最小的值. def func(**args): return max(args),min(args) 定义一个方法 ...

  2. vue中子组件的created、mounted钩子中获取不到props中的值问题

    父子组件通信 这个官网很清楚,也很简单,父组件中使用v-bind绑定传送,子组件使用props接收即可 例如: 父组件中: <template> <div> <head- ...

  3. docker 学习1 WSL docker ,Windows docker

    获取Linux内核版本 //使用 lsb_release -a 可见我电脑上的 WSL Linux 版本是 Ubuntu的. 安装docker for ubuntu (遇到问题) 转[http://b ...

  4. BPM软件_财务报销流程管理解决方案_K2工作流引擎

    财务报销,对任何企业都是日常运营中重要的一个环节.但报销流程周期长,反复签字手续繁杂,报销过程不透明 ,单据归档保存.检索困难等问题也让员工头疼.为了解决这些困扰,财务报销流程电子化一时成为热门之选. ...

  5. SQL中新建注释、查询注释和说明

    1.查询注释 SELECT A.name AS table_name, B.name AS column_name, C.value AS column_description FROM sys.ta ...

  6. clipboard兼容各个浏览器,不需要设置权限

    解决方案:用clipboard.js插件 注意要引用clipboard.js文件 案例: 将文本赋值给剪切板 <button class="btn">Copy</ ...

  7. leetcode-102.层序遍历二叉树(正序)· BTree

    题面 Given a binary tree, return the level order traversal of its nodes' values. (ie, from left to rig ...

  8. 从ABAP Netweaver的SICF到SAP Kyma的Lambda Function

    ABAP Netweaver里的事务码SICF是Jerry做原型开发时非常喜欢使用的一个工具:但凡遇到需要把ABAP系统里的资源以服务的方式暴露出来的场景,Jerry都喜欢在SICF里创建一个服务节点 ...

  9. pcntl

    <?php function my_pcntl_wait($childProcessCode){ $pid = pcntl_fork(); if($pid>0){ pcntl_wait($ ...

  10. kafka学习遗留问题

    1.ZK在kafka中的作用 2.Kafka支持优先级队列么 未完待续