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

Hi everyone, I'm designing my company's website and I need to solve this doubt.

I have created a template with a (button / input(type=button)) and I need to detect in my python file, when the button is clicked for realize some actions. Any help?

I'm using the next code in the template:

<div id="insertar">
<button id="btn_insert_economic_data" type="button"
class="btn btn-success">Insert data</button>
</div>

And the next one in the python file:

@http.route(['/my/economic_data/delete/<int:data>'], type='http', auth="user",
website=True)
def portal_delete_economic_data(self, data=None, access_token=None, **kw):

......

Thanks for reading!

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

And can I call a python function using this method?

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

use javascript for button click and the invoke this method from that particular action

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
1
thg 4 25
978
0
thg 12 15
6928
1
thg 8 22
6703
0
thg 4 22
3055
0
thg 4 22
6