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.
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()
-------------------------
Creează-ți un cont astăzi pentru a beneficia de funcții exclusive și a interacționa cu minunata noastră comunitate!
Înscrie-te| Postări similare | Răspunsuri | Vizualizări | Activitate | |
|---|---|---|---|---|
|
2
apr. 21
|
6570 | |||
|
How to solved this SQL error ??
Rezolvat
|
1
sept. 21
|
4443 | ||
|
0
oct. 21
|
1691 | |||
|
2
dec. 23
|
33074 | |||
|
1
iun. 15
|
20090 |
1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.