Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
Coopdevs OCB mirror
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
External wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Coopdevs
Odoo
Coopdevs OCB mirror
Commits
c58751f2
Commit
c58751f2
authored
5 years ago
by
Victor Feyens
Browse files
Options
Downloads
Patches
Plain Diff
[IMP] doc: controllers organisation + minor correction
parent
82a90aa2
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
doc/howtos/website.rst
+1
-1
1 addition, 1 deletion
doc/howtos/website.rst
doc/reference/http.rst
+41
-41
41 additions, 41 deletions
doc/reference/http.rst
doc/reference/views.rst
+1
-1
1 addition, 1 deletion
doc/reference/views.rst
with
43 additions
and
43 deletions
doc/howtos/website.rst
+
1
−
1
View file @
c58751f2
...
...
@@ -58,7 +58,7 @@ Although it does absolutely nothing we can install it:
To the browser
==============
:ref:`Controllers <reference/
http/
controllers>` interpret browser requests and
:ref:`Controllers <reference/controllers>` interpret browser requests and
send data back.
Add a simple controller and ensure it is imported by ``__init__.py`` (so
...
...
This diff is collapsed.
Click to expand it.
doc/reference/http.rst
+
41
−
41
View file @
c58751f2
:banner: banners/web_controllers.jpg
.. _reference/controllers:
===============
Web Controllers
===============
.. _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:
.. _reference/http/controllers:
Controllers
===========
...
...
@@ -51,11 +17,8 @@ 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
.. autoclass:: odoo.http.Controller
and defining methods decorated with :func:`~odoo.http.route`::
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')
...
...
@@ -85,3 +48,40 @@ class and override relevant methods, re-exposing them if necessary::
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:
This diff is collapsed.
Click to expand it.
doc/reference/views.rst
+
1
−
1
View file @
c58751f2
...
...
@@ -48,7 +48,7 @@ otherwise.
a route address to be fetched and prepended to the view.
If this attribute is set, the
:ref:`controller route url<reference/
http/
controllers>` will be fetched and
:ref:`controller route url<reference/controllers>` will be fetched and
displayed above the view. The json response from the controller should
contain an "html" key.
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment