Odoo 13如何在http控制器中使用werkzeug Mixin
我对如何使用Werkzeugs Mixin类感到困惑,特别是AuthorizationMixin。 在my controller.py中,我有:Odoo 13如何在http控制器中使用werkzeug Mixin,http,odoo,werkzeug,Http,Odoo,Werkzeug,我对如何使用Werkzeugs Mixin类感到困惑,特别是AuthorizationMixin。 在my controller.py中,我有: from odoo import http from odoo.http import request, Response from werkzeug.wrappers import AuthorizationMixin, BaseRequest class Request(BaseRequest, AuthorizationMixin):
from odoo import http
from odoo.http import request, Response
from werkzeug.wrappers import AuthorizationMixin, BaseRequest
class Request(BaseRequest, AuthorizationMixin):
pass
class MyRoute(http.Controller):
@http.route()
def handler():
#stuff I do in route
但是当我尝试记录request.httprequest.authorization
时,我得到了None
。我有一个模糊的理解,我需要创建一个新的odoo.http.WebRequest(httprequest)
,并给它我的新的扩展Request
,它使用了AuthorizationMixin,但我对连接点有疑问