odoo/doc/howto/howto_website/url-pattern

31 lines
914 B
Plaintext

# HG changeset patch
# Parent f7adcd9a5a8e0dc1c7438f94dde2faefd6406a30
diff --git a/controllers/academy.py b/controllers/academy.py
--- a/controllers/academy.py
+++ b/controllers/academy.py
@@ -15,7 +15,7 @@ class academy(main.Home):
@http.route('/', auth='none')
def index(self):
tas = [
- '<li><a href="/tas/?id=%d">%s</a></li>' % (i, ta['name'])
+ '<li><a href="/tas/%d/">%s</a></li>' % (i, ta['name'])
for i, ta in enumerate(teaching_assistants)
]
@@ -39,7 +39,7 @@ class academy(main.Home):
'tas': '\n'.join(tas)
}
- @http.route('/tas', auth='none')
+ @http.route('/tas/<int:id>/', auth='none')
def ta(self, id):
return """<!doctype html>
<html>
@@ -51,4 +51,4 @@ class academy(main.Home):
<h1>%(name)s</h1>
</body>
</html>
-""" % teaching_assistants[int(id)]
+""" % teaching_assistants[id]