Added werkzeug's arguments
bzr revid: nicolas.vanhoren@openerp.com-20130620121026-btc06m36x9jg1ok0
This commit is contained in:
parent
027f77a3ce
commit
4119d7ce99
|
@ -1115,7 +1115,7 @@ class DataSet(http.Controller):
|
||||||
return self._call_kw(model, method, args, {})
|
return self._call_kw(model, method, args, {})
|
||||||
|
|
||||||
@http.route(['/web/dataset/call_kw', '/web/dataset/call_kw/<path:path>'], type='json', authentication="auth")
|
@http.route(['/web/dataset/call_kw', '/web/dataset/call_kw/<path:path>'], type='json', authentication="auth")
|
||||||
def call_kw(self, model, method, args, kwargs):
|
def call_kw(self, model, method, args, kwargs, path=None):
|
||||||
return self._call_kw(model, method, args, kwargs)
|
return self._call_kw(model, method, args, kwargs)
|
||||||
|
|
||||||
@http.route('/web/dataset/call_button', type='json', authentication="auth")
|
@http.route('/web/dataset/call_button', type='json', authentication="auth")
|
||||||
|
|
|
@ -417,7 +417,7 @@ def jsonrequest(f):
|
||||||
base = f.__name__
|
base = f.__name__
|
||||||
if f.__name__ == "index":
|
if f.__name__ == "index":
|
||||||
base = ""
|
base = ""
|
||||||
return route([base, os.path.join(base, "<path:path>")], type="json", authentication="auth")(f)
|
return route([base, os.path.join(base, "<path:_ignored_path>")], type="json", authentication="auth")(f)
|
||||||
|
|
||||||
class HttpRequest(WebRequest):
|
class HttpRequest(WebRequest):
|
||||||
""" Regular GET/POST request
|
""" Regular GET/POST request
|
||||||
|
@ -500,7 +500,7 @@ def httprequest(f):
|
||||||
base = f.__name__
|
base = f.__name__
|
||||||
if f.__name__ == "index":
|
if f.__name__ == "index":
|
||||||
base = ""
|
base = ""
|
||||||
return route([base, os.path.join(base, "<path:path>")], type="http", authentication="auth")(f)
|
return route([base, os.path.join(base, "<path:_ignored_path>")], type="http", authentication="auth")(f)
|
||||||
|
|
||||||
#----------------------------------------------------------
|
#----------------------------------------------------------
|
||||||
# Local storage of requests
|
# Local storage of requests
|
||||||
|
@ -865,9 +865,15 @@ class Root(object):
|
||||||
"""
|
"""
|
||||||
path = request.httprequest.path
|
path = request.httprequest.path
|
||||||
urls = self.get_db_router(request.db).bind("")
|
urls = self.get_db_router(request.db).bind("")
|
||||||
func, original = urls.match(path)[0]
|
matched, arguments = urls.match(path)
|
||||||
|
arguments = dict([(k, v) for k, v in arguments.items() if not k.startswith("_ignored_")])
|
||||||
|
func, original = matched
|
||||||
|
|
||||||
request.func = func
|
def nfunc(*args, **kwargs):
|
||||||
|
kwargs.update(arguments)
|
||||||
|
return func(*args, **kwargs)
|
||||||
|
|
||||||
|
request.func = nfunc
|
||||||
request.auth_method = getattr(original, "auth", "auth")
|
request.auth_method = getattr(original, "auth", "auth")
|
||||||
request.func_request_type = original.exposed
|
request.func_request_type = original.exposed
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue