跳至内容
菜单
此问题已终结
3 回复
12418 查看

How to execute sql query on website controller?


I need to get data from a many2many field:

my code:

        self.env.execute('SELECT * from customer_ids')

        res = self.env.fetchall()

     

But this doesn't work in the controllers. Hope you can help me. Thank you.


形象
丢弃
最佳答案
query = "you query goes here"    
request.cr.execute(query)   
data = request.cr.fetchall() 
-------------------------
形象
丢弃
编写者

Thank you so much. It worked.

most welcome

相关帖文 回复 查看 活动
2
4月 21
4950
1
9月 21
2606
0
10月 21
1691
2
12月 23
30796
1
6月 15
17683