ir.http
在openrep.http.Root.dispatch()中,通过ir_http = request.registry['ir.http']得到base/ir.ir_http
try:
with openerp.tools.mute_logger('openerp.sql_db'):
ir_http = request.registry['ir.http']
except (AttributeError, psycopg2.OperationalError):
request.session.logout()
result = _dispatch_nodb()
else:
result = ir_http._dispatch()
ir.http._dispatch
ir.http._dispatch调用ir.http._find_handler()
def _dispatch(self):
try:
rule, arguments = self._find_handler(return_rule=True)
func = rule.endpoint
except werkzeug.exceptions.NotFound, e:
return self._handle_exception(e)
...
try:
request.set_handler(func, arguments, auth_method)#设置处理函数,在request.dispatch()中调用
result = request.dispatch()

本文深入探讨Odoo的ir.http模块,讲解了从_ir_http_的_dispatch_方法到_http.routing_map_的URL路由过程,以及_openerp.http.HttpRequest_在请求处理中的作用。
最低0.47元/天 解锁文章
1万+





