콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다
1 회신
3797 화면

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
Search a message 해결 완료
1
2월 25
1207
0
9월 23
2149
2
8월 23
3221
2
6월 23
3905