diff options
| author | Victor Feyens <vfe@odoo.com> | 2021-04-30 13:24:57 +0000 |
|---|---|---|
| committer | Antoine Vandevenne (anv) <anv@odoo.com> | 2021-05-04 08:09:20 +0000 |
| commit | 27bad8c3e32049ec69a588df0558e57a0b928309 (patch) | |
| tree | b60e430163d486c8c1fd052738c9854aeb8300f5 /doc/reference/http.rst | |
| parent | 75a122bbae3a32bfa79da3506179fc63a8bced5d (diff) | |
[MOV] doc: move documentation to a dedicated repository
In odoo/documentation-user#945, the developer documentation is merged
with the user documentation in a single repository and build config.
This commit then removes source files for the developer documentation
from the odoo/odoo repository.
DOC PR: https://github.com/odoo/documentation-user/pull/945
task-2351938
task-2352371
task-2205684
task-2352544
Co-authored-by: Victor Feyens <vfe@odoo.com>
Co-authored-by: Antoine Vandevenne <anv@odoo.com>
Diffstat (limited to 'doc/reference/http.rst')
| -rw-r--r-- | doc/reference/http.rst | 87 |
1 files changed, 0 insertions, 87 deletions
diff --git a/doc/reference/http.rst b/doc/reference/http.rst deleted file mode 100644 index 0675847aaa0..00000000000 --- a/doc/reference/http.rst +++ /dev/null @@ -1,87 +0,0 @@ -:banner: banners/web_controllers.jpg - -.. _reference/controllers: - -=============== -Web Controllers -=============== - -Controllers -=========== - -Controllers need to provide extensibility, much like -:class:`~odoo.models.Model`, but can't use the same mechanism as the -pre-requisites (a database with loaded modules) may not be available yet (e.g. -no database created, or no database selected). - -Controllers thus provide their own extension mechanism, separate from that of -models: - -Controllers are created by :ref:`inheriting <python:tut-inheritance>` from :class:`~odoo.http.Controller`. -Routes are defined through methods decorated with :func:`~odoo.http.route`:: - - class MyController(odoo.http.Controller): - @route('/some_url', auth='public') - def handler(self): - return stuff() - -To *override* a controller, :ref:`inherit <python:tut-inheritance>` from its -class and override relevant methods, re-exposing them if necessary:: - - class Extension(MyController): - @route() - def handler(self): - do_before() - return super(Extension, self).handler() - -* decorating with :func:`~odoo.http.route` is necessary to keep the method - (and route) visible: if the method is redefined without decorating, it - will be "unpublished" -* the decorators of all methods are combined, if the overriding method's - decorator has no argument all previous ones will be kept, any provided - argument will override previously defined ones e.g.:: - - class Restrict(MyController): - @route(auth='user') - def handler(self): - return super(Restrict, self).handler() - - will change ``/some_url`` from public authentication to user (requiring a - log-in) - -API -=== - -.. _reference/http/routing: - -Routing -------- - -.. autofunction:: odoo.http.route - -.. _reference/http/request: - -Request -------- - -The request object is automatically set on :data:`odoo.http.request` at -the start of the request - -.. autoclass:: odoo.http.WebRequest - :members: - :member-order: bysource -.. autoclass:: odoo.http.HttpRequest - :members: -.. autoclass:: odoo.http.JsonRequest - :members: - -Response --------- - -.. autoclass:: odoo.http.Response - :members: - :member-order: bysource - - .. maybe set this to document all the fine methods on Werkzeug's Response - object? (it works) - :inherited-members: |
