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

Hi everyone, in the Recruitment app, when configuring an automated email, I ran across the following templated expression for the "email_to" field:

{{ (not object.partner_id and object.email_from or '') }}


I noticed that this expression evaluates to object.email_from, which is the email of the applicant (I validated this because my test applicant received an email). However, I can't find any documentation to explain why it evaluated to this value; according to my programming kwowledge, this expression should evaluate to a Boolean (True or False) value, since it has AND and OR keywords.


If anyone could explain how dynamic placeholders are evaluated I'd be much appreciated! thanks. 


아바타
취소
작성자 베스트 답변

You are totally right, a bit embarrassing for a Python programmer to have forgotten about this :D 

Thanks a lot!

아바타
취소
베스트 답변

Hi Fred: This is how python works. It's the pythonic way of saying,

if the record does not have a partner_id return email_from else return ''

You can test it by assigning the value of the expression to a variable and printing out it's value.


아바타
취소
관련 게시물 답글 화면 활동
1
3월 21
7551
1
12월 24
1260
0
1월 24
1339
0
7월 20
3831
9
5월 25
18311