summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorXavier Morel <xmo@openerp.com>2014-02-07 14:32:33 +0100
committerXavier Morel <xmo@openerp.com>2014-05-19 08:32:12 +0200
commitfdc63e3a67f4db8599d1aaab7eb91e783c74ac80 (patch)
treea4191e212d0a8713baa828ebba4079f4e6c035f0 /doc
parentc9d43711192be3b55998ec2a28ae4a889760c55e (diff)
[IMP] some titles, move auth=public from website-dependency to website-layoutify
auth=public is not necessary to depending on website, however rendering within website/website's layout blows up if there is no current user
Diffstat (limited to 'doc')
-rw-r--r--doc/howto/howto_website.rst14
-rw-r--r--doc/howto/howto_website/website-dependency11
-rw-r--r--doc/howto/howto_website/website-layoutify20
3 files changed, 30 insertions, 15 deletions
diff --git a/doc/howto/howto_website.rst b/doc/howto/howto_website.rst
index 65a6ed18327..576638e9444 100644
--- a/doc/howto/howto_website.rst
+++ b/doc/howto/howto_website.rst
@@ -15,8 +15,8 @@ Howto: build a website with OpenERP
For production deployment, see the dedicated guides :ref:`using-gunicorn`
and :ref:`using-mod-wsgi`.
-Hello, world!
-=============
+Creating a basic module
+=======================
In OpenERP, doing things takes the form of creating modules, and these modules
customize the behavior of the OpenERP installation. The first step is thus to
@@ -82,8 +82,8 @@ returned by the ``index`` method to get a more page-ish output:
.. todo:: screenshot
-Data input: URL and query
-=========================
+Controller Parameters
+=====================
Being able to build a static page in code is nice, but makes for limited
usefulness (you could do that with static files).
@@ -116,8 +116,8 @@ from a string URL section to a python integer) and will perform a some
validation (if the ``id`` is not a valid integer, the converter will return a
``404 Not Found`` instead of a 500 server error when the conversion fails).
-Templating: better experience in editing
-========================================
+Basic templates
+===============
So far we've output HTML by munging strings. It works, but is not exactly fun
to edit (and somewhat unsafe to boot) as even advanced text editors have a
@@ -273,7 +273,7 @@ installed after the ``academy`` module, its index page takes over routing (two
index pages exist, and one is picked over the other).
To fix the issue, we can simply add ``website`` as a dependency to ``academy``
-(that is, tell OpenERP that ``academy`` needs ``website`` to work right):
+(that is, tell OpenERP that ``academy`` needs ``website`` to work correctly):
.. needs -u all to update metadata
diff --git a/doc/howto/howto_website/website-dependency b/doc/howto/howto_website/website-dependency
index 5f34268f763..5bd57a25da4 100644
--- a/doc/howto/howto_website/website-dependency
+++ b/doc/howto/howto_website/website-dependency
@@ -1,5 +1,5 @@
# HG changeset patch
-# Parent b2da66732141558bdf8fcc21000b98a8b67a1340
+# Parent f84f5783ecf4eabd018fd27548423b5cefc1d2dc
diff --git a/__openerp__.py b/__openerp__.py
--- a/__openerp__.py
@@ -16,12 +16,9 @@ diff --git a/__openerp__.py b/__openerp__.py
diff --git a/controllers/my_controller.py b/controllers/my_controller.py
--- a/controllers/my_controller.py
+++ b/controllers/my_controller.py
-@@ -12,20 +12,12 @@ teaching_assistants = [
- ]
-
+@@ -14,18 +14,10 @@ teaching_assistants = [
class my_controller(main.Home):
-- @http.route('/', auth='none')
-+ @http.route('/', auth='public')
+ @http.route('/', auth='none')
def index(self):
- cr, uid, context = http.request.cr, http.request.uid, http.request.context
- tas = [
@@ -37,7 +34,7 @@ diff --git a/controllers/my_controller.py b/controllers/my_controller.py
- }, context=context)
-
- @http.route('/tas/<int:id>/', auth='none')
-+ @http.route('/tas/<int:id>/', auth='public', website=True)
++ @http.route('/tas/<int:id>/', auth='none', website=True)
def ta(self, id):
- cr, uid, context = http.request.cr, http.request.uid, http.request.context
- return http.request.registry['ir.ui.view'].render(
diff --git a/doc/howto/howto_website/website-layoutify b/doc/howto/howto_website/website-layoutify
index 204e1305c1a..f18130493de 100644
--- a/doc/howto/howto_website/website-layoutify
+++ b/doc/howto/howto_website/website-layoutify
@@ -1,6 +1,24 @@
# HG changeset patch
-# Parent 307d452da9602b1bc1a8ed208e6949924ba0e5cf
+# Parent 341dd9480911ad71df915449944e21275a1f32c6
+diff --git a/controllers/my_controller.py b/controllers/my_controller.py
+--- a/controllers/my_controller.py
++++ b/controllers/my_controller.py
+@@ -12,12 +12,12 @@ teaching_assistants = [
+ ]
+
+ class my_controller(main.Home):
+- @http.route('/', auth='none')
++ @http.route('/', auth='public')
+ def index(self):
+ return http.request.website.render('academy.index', {
+ 'tas': teaching_assistants,
+ })
+
+- @http.route('/tas/<int:id>/', auth='none', website=True)
++ @http.route('/tas/<int:id>/', auth='public', website=True)
+ def ta(self, id):
+ return http.request.website.render('academy.ta', teaching_assistants[id])
diff --git a/views/templates.xml b/views/templates.xml
--- a/views/templates.xml
+++ b/views/templates.xml