コンテンツへスキップ
メニュー
この質問にフラグが付けられました
1 返信
3356 ビュー

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
3561
0
5月 24
46
4
9月 23
4852
2
9月 23
7081
1
8月 23
2537