콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다

i want to get current url from javascript and i keep current url in session on controller and call the session in my model but i got nothing and no error:

controller.py:

@http.route(['/action_set_current_url/<string:url>'], type='json', auth="public")
def set_current_url(self, url, **post):
request.session['my_current_url'] = url
return {"my_current_url":my_current_url}

mymodel.py to get session:

current_url = http.request.session.get('my_current_url')

javascript code:

$(window).on('hashchange', function(e){
var url=window.location.href
    openerp.jsonRpc("/action_set_current_url/", 'call',url)
});
아바타
취소

in the js, console the url and check whether there is value inside it

작성자

how to check the value inside when i'm working in remote server??

you can check the in console of the browser

관련 게시물 답글 화면 활동
1
6월 15
10628
0
11월 23
1954
1
12월 20
5011
3
7월 19
15297
0
3월 18
365