Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
2 ตอบกลับ
7270 มุมมอง

    from openerp.osv.orm import except_orm, Model, TransientModel, AbstractModel
  File "/usr/lib/python2.6/site-packages/openerp-8.0dev_20140416_230101-py2.6.egg/openerp/osv/orm.py", line 2404
    groupby_dict = {gb['groupby']: gb for gb in annotated_groupbys}
                                        ^
SyntaxError: invalid syntax

 

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

Hi,

the dict comprehension doesn't work on python 2.6, then you have to install python 2.7 and use it.

อวตาร
ละทิ้ง
ผู้เขียน คำตอบที่ดีที่สุด

Dict comprehensions were added to the language in version 2.7.

So you need to upgrade to Python 2.7. If you're stuck with 2.6, you could use

groupby_dict = dict((gb['groupby'], gb) for gb in annotated_groupbys)

this is  answer ?

Thanks .

 

อวตาร
ละทิ้ง