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

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