~loyalinfo/openobject-server/trunk

Viewing all changes in revision 4991.

  • Committer: Antony Lesuisse
  • Date: 2013-11-10 14:27:31 UTC
  • mfrom: (4990.1.6 trunk)
  • Revision ID: al@openerp.com-20131110142731-qi9910fkty25cdtd
[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.

expand all expand all

Show diffs side-by-side

added added

removed removed

Lines of Context: