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()