/*****************************************************************************************
 *          AttributeError: 'dict_values' object has no attribute 'translate'
 * 说明:
 *     由于目前使用的是Python3,在解读MySQL的ORM库的时候,结果直接遇到这个错误。
 * 
 *                                                       2016-10-13 深圳 南山平山村 曾剑锋
 ****************************************************************************************/

一、参考文档:
    1. Get: TypeError: 'dict_values' object does not support indexing when using python 3.2.3 [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()))

 

相关文章:

  • 2021-06-21
  • 2021-08-31
  • 2021-12-04
  • 2021-07-25
  • 2021-06-22
  • 2021-06-16
  • 2021-08-06
  • 2021-06-13
猜你喜欢
  • 2022-12-23
  • 2021-05-22
  • 2021-09-15
  • 2021-12-07
  • 2021-12-14
  • 2021-06-06
  • 2021-07-27
相关资源
相似解决方案