[IMP] http move db dispatching to AbstractModel ir.http
authorAntony Lesuisse <al@openerp.com>
Sun, 10 Nov 2013 14:27:31 +0000 (15:27 +0100)
committerAntony Lesuisse <al@openerp.com>
Sun, 10 Nov 2013 14:27:31 +0000 (15:27 +0100)
commitee4c1f702e57bfbd2d80586074f76058941aeb99
tree0795bf78e29b6cac217ef434a8a685af4a0cf5c3
parent14245e24fc3fd43f111d445cc0526232a442acab
parent5f9ef80d70fd6696686331724174294d58a0c7bf
[IMP] http move db dispatching to AbstractModel ir.http

Allow module to override the http dispatching process:
- The default implementation uses werkzeug.routing but any other method could
  be used, it'a also possible to pre/postprocess (i.e. url aliases)
- Authentication (auth param on route) is plugggable by defining now
  _auth_method_<methodname>
- Error handler are overridable, any module can define a new exception and
  handle it by orverriding the _handle_<error_code> method.
- Add model converters for routes, to directly get the browse record example
  @route(['/job/detail/<model("hr.job"):job>'], type='http', auth="user")

This is done by splitting dispatching, when the db is unknown low level http.py
dispatching is used, it's only used by a few controller in base and web. When
the db is known, ir_http is used because it's a regular Model it is fully
overridable by openerp modules.

bzr revid: al@openerp.com-20131110142731-qi9910fkty25cdtd
openerp/addons/base/ir/ir_http.py