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

hi,

i want to make one controller in that i want to access querystring from that url

so how can i do that

الصورة الرمزية
إهمال
أفضل إجابة

Hi


FROM CONTROLLER

if you déclare thé controller with:


def my_route(self, named_param, **kw)

     print named_param

     print kw.get('another_param')


And browse it with:

my_website/my_route?named_param=foo&another_param=bar


will output:

    foo

    bar


FROM QWEB


<t t-esc="request.params.get('another_param')" />




You can find more détails un the documentation: 

https://www.odoo.com/documentation/10.0/reference/http.html

الصورة الرمزية
إهمال
الكاتب

thanks it works for me

أفضل إجابة

I have a problem if the foo is an object, how do I write in the url to call?
my_website/my_route?named_param=foo&another_param=bar​

الصورة الرمزية
إهمال
المنشورات ذات الصلة الردود أدوات العرض النشاط
2
يناير 20
7462
0
نوفمبر 23
1788
2
سبتمبر 20
11688
1
نوفمبر 19
8453
0
مايو 19
4908