Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
1 Trả lời
3354 Lượt xem

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?

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

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

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
3
thg 2 25
3554
0
thg 5 24
46
4
thg 9 23
4847
2
thg 9 23
7074
1
thg 8 23
2534