/*****************************************************************************************
* 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. 在浏览器中将表格导入到本地的EXCEL文件,注意控制内存

    if ($export_flag == 1) { $rr = $this->mdl->test($test); header("Content-Type: application ...

  2. 在eclipse导入项目的步骤【转】

    1. Import 2. Next 3. 确定  选中copy projects into workspace    Finish 这样项目就导入进来了. 4.导入jar包 Configure Bui ...

  3. 使用@Controller注解为什么要配置<mvc:annotation-driven />

    自己看了官方文档,也到网上查了下,目前理解如下: <mvc:annotation-driven/>相当于注册了DefaultAnnotationHandlerMapping和Annotat ...

  4. mysql连接数据库p的大小写

    命令:mysql -uroot -p -hlocalhost -P3306 -h 用来指定远程主机的IP -P (大写) 用来指定远程主机MYAQL的绑定端口

  5. Div层的展开与收缩的代码

    <html> <head> <title>div展开收缩代码</title> <style> * { margin:0; padding:0 ...

  6. ZOJ 3329 One Person Game 概率DP 期望 难度:2

    http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=3754 本题分数为0的概率不确定,所以不能从0这端出发. 设E[i]为到达成功所 ...

  7. ios开发逆向传值的几种方法整理

    第一种:代理传值 第二个控制器: @protocol WJSecondViewControllerDelegate <NSObject> - (void)changeText:(NSStr ...

  8. 表(list)

    表 表(list)是常见的数据结构.从数学上来说,表是一个有序的元素集合.在C语言的内存中,表储存为分散的节点(node).每个节点包含有一个元素,以及一个指向下一个(或者上一个)元素的指针.如下图所 ...

  9. MapReduce基础

    这篇文章翻译自Yahoo的Hadoop教程,很久之前就看过了,感觉还不错.最近想总结一下以前学的东西,看到现在关于Hadoop的中文资料还比较少,就有了把它翻译出来的想法,希望能帮助到初学者.这只是Y ...

  10. 记录一些容易忘记的属性 -- NSTimer

    使定时器停止的方法: 1. //将定时器的启动时间设置为很久以后的将来,到这个时间,定时器才会开始工作            [_timer setFireDate:[NSDate distantFu ...