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

Hi,

I have a python method which is going to return a value. I want to call it on the inherit_id attribute of template tag. How can i achieve this?

아바타
취소
베스트 답변

Hi

You can try this code

XML:

<?xml version="1.0" encoding="UTF-8"?>

<templates xml:space="preserve">

<t t-name="your_module_name.custom_template_tag_name">

<t t-set="value" t-value="your_python_method()"/>

        <t t-esc="value"/>

    </t>

</templates>


Hope it helps

아바타
취소
관련 게시물 답글 화면 활동
3
2월 25
3528
0
5월 24
46
4
9월 23
4828
2
9월 23
7038
1
8월 23
2517