/*****************************************************************************************
* AttributeError: 'dict_values' object has no attribute 'translate'
* 说明:
* 由于目前使用的是Python3,在解读MySQL的ORM库的时候,结果直接遇到这个错误。
*
* 2016-10-13 深圳 南山平山村 曾剑锋
****************************************************************************************/ 一、参考文档:
. Get: TypeError: 'dict_values' object does not support indexing when using python 3.2. [duplicate]
http://stackoverflow.com/questions/17431638/get-typeerror-dict-values-object-does-not-support-indexing-when-using-python 二、解决方法:
return Database.execute(insert, self.__dict__.values())
to
return Database.execute(insert, list(self.__dict__.values()))

AttributeError: 'dict_values' object has no attribute 'translate'的更多相关文章

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

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

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

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

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

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

  4. attributeError:'module' object has no attribute ** 解决办法

    写了一个小脚本,执行的时候报错: Traceback (most recent call last): File "F:/test/qrcode.py", line 109, in ...

  5. AttributeError: 'module' object has no attribute 'TornadoAsyncNotifier'

    /*************************************************************************** * AttributeError: 'modu ...

  6. python3 AttributeError: 'NoneType' object has no attribute 'split'

    from wsgiref.simple_server import make_server def RunServer(environ, start_response): start_response ...

  7. 对于AttributeError: 'Flask' object has no attribute 'cli'的解决办法

    版权声明:本文为博主原创文章,未经博主允许不得转载. 环境flask-script2.0.5.flask0.10.1 运行官方文档sample 出现问题 c:\kk\flask\examples\fl ...

  8. AttributeError: 'module' object has no attribute 'Thread'

    $ python thread.py starting at: 2015-08-05 00:24:24Traceback (most recent call last):  File "th ...

  9. 解决window7 x64位Anaconda启动报错:AttributeError: '_NamespacePath' object has no attribute 'sort'

    最近论文需要用到python做数据分析,python语法简单,但是Windows下安装第三方包恶心的要命,statsmodels用pip死活安装不上,网上查了说包相互依赖windows下的pip不能下 ...

随机推荐

  1. 使用Yeoman,Grunt和Bower开发AngularJS(译)

    使用Yeoman产生AngularJS的主要骨架 使用Grunt加速开发和帮助执行 使用Bower来加入第三方插件和框架——third party plugins/frameworks 一.准备工作 ...

  2. JavaScript中的test()方法

    定义和用法 test() 方法用于检测一个字符串是否匹配某个模式. 语法 RegExpObject.test(string) 参数 描述 string 必需.要检测的字符串. 返回值 如果字符串 st ...

  3. JDE客户端get时报错“ERROR:fetch from table F0101 failed”

    客户端开发时发现总报错误“ERROR:fetch from table F0101 failed” 原因是用户ID在地址名册中找不到地址号.修改用户地址号即可.如下图所示

  4. java 访问活动目录代码

    package demo; import java.util.Hashtable; import javax.naming.Context; import javax.naming.NamingEnu ...

  5. C#入门篇6-5:字符串操作 测试StringBuilder的运行效率

    //测试StringBuilder的运行效率 public static void Fun2() { #region string string str = "我喜欢编程!"; / ...

  6. [示例]NSDictionary编程题-字典的排序应用(iOS7班)

    代码: #import <Foundation/Foundation.h> int main(int argc, const char * argv[]) { @autoreleasepo ...

  7. VS2010连接SQLite数据库

    Visual studio 2010及以上版本,连接SQLite数据库 1.在Sqlite开发站点下载SQLite的.exe安装包 Ctrl+F搜索这条语句:This is the only setu ...

  8. jquery表单提交和重置

    $('#myform').submit() 表单提交 $('#myform')[0].reset() 表单重置

  9. 标准库源码--wsgi服务器

    功能模块化带来可自由组装的便利: 使用python的mixin特性装配 class ThreadHTTPServer(ThreadingMixin, HTTPServer): pass 上面表示1个请 ...

  10. hdu 1031 (partial sort problem, nth_element, stable_partition, lambda expression) 分类: hdoj 2015-06-15 17:47 26人阅读 评论(0) 收藏

    partial sort. first use std::nth_element to find pivot, then use std::stable_partition with the pivo ...