Skip ke Konten
Menu
Pertanyaan ini telah diberikan tanda
3 Replies
12571 Tampilan

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.


Avatar
Buang
Jawaban Terbai
query = "you query goes here"    
request.cr.execute(query)   
data = request.cr.fetchall() 
-------------------------
Avatar
Buang
Penulis

Thank you so much. It worked.

most welcome

Post Terkait Replies Tampilan Aktivitas
2
Apr 21
5124
1
Sep 21
2744
0
Okt 21
1691
2
Des 23
31051
1
Jun 15
17908