跳至內容
選單
此問題已被標幟
1 回覆
3800 瀏覽次數

I get email from client side and i need to check that email in respective model in server and return result from record related to that email. tried to do soo from this code but got error string index out of range. How can i solve this ?

email_add = rec['email']
records = request.env['colorvisualizer.key'].sudo().search(['email','=',email_add])
for dat in records:
email = dat.email

頭像
捨棄
最佳答案

HI,


try with below, because you forgot 1 bracket in search.

records = request.env['colorvisualizer.key'].sudo().search([('email','=',email_add)])

Thanks & Regards,

Sunny Sheth

頭像
捨棄
作者

it works

thank you soo much

相關帖文 回覆 瀏覽次數 活動
1
7月 25
389
1
2月 25
1207
0
9月 23
2149
2
8月 23
3221
2
6月 23
3905