تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
2 الردود
5941 أدوات العرض

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
أبريل 25
932
0
ديسمبر 15
6903
1
أغسطس 22
6645
0
أبريل 22
2988
0
أبريل 22
6