Merge lp:~openerp-dev/openobject-server/trunk-multirouters-niv into lp:openobject-server
Status: | Needs review |
---|---|
Proposed branch: | lp:~openerp-dev/openobject-server/trunk-multirouters-niv |
Merge into: | lp:openobject-server |
Diff against target: |
446 lines (+221/-139) (has conflicts) 1 file modified
openerp/http.py (+221/-139) Text conflict in openerp/http.py |
To merge this branch: | bzr merge lp:~openerp-dev/openobject-server/trunk-multirouters-niv |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Xavier (Open ERP) | Pending | ||
Review via email: mp+193285@code.launchpad.net |
Description of the change
Allows to define and register multiple "routers" in the http.py API.
Routers are objects that are used *after* the http.py api handled the session management and the database detection. Routers are dedicated to handle with a request (guess what method to call and call it). A router is always linked to a specific database and a new set of routers will be created for each database. This includes the "None" database, which means the cases when the server has to perform requests without knowing the current database.
Multiple routers creators functions can be defined, which means that multiple routers will exist per database. When a request arrives, each router will be tried one after the other and each time they return None we switch to the next one.
As is the behavior is almost completely unchanged. The logic that was in the Root class has moved in the WerkzeugRouter class. That last class is designed to be extended to create new routers with the same basic features and added functionality.
Unmerged revisions
- 4989. By Nicolas Vanhoren (OpenERP)
-
Fix problem with controllers
- 4988. By Nicolas Vanhoren (OpenERP)
-
Added magic to be able to create new Controller classes
- 4987. By Nicolas Vanhoren (OpenERP)
-
Architecture change to be able to detect if an url is routable without actually executing the action.
- 4986. By Nicolas Vanhoren (OpenERP)
-
Now trying multiple routers seems to work correctly
- 4985. By Nicolas Vanhoren (OpenERP)
-
Added router registerer
- 4984. By Nicolas Vanhoren (OpenERP)
-
Extracted the routing in the WerkzeugRouter class