Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
2 ตอบกลับ
5965 มุมมอง

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

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
1
เม.ย. 25
945
0
ธ.ค. 15
6914
1
ส.ค. 22
6660
0
เม.ย. 22
3002
0
เม.ย. 22
6