跳至內容
選單
此問題已被標幟
2 回覆
5690 瀏覽次數

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!

頭像
捨棄
作者 最佳答案

And can I call a python function using this method?

頭像
捨棄
最佳答案

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

頭像
捨棄
相關帖文 回覆 瀏覽次數 活動
1
4月 25
577
0
12月 15
6572
1
8月 22
6465
0
4月 22
2712
0
4月 22
6