40 lines
1.5 KiB
Plaintext
40 lines
1.5 KiB
Plaintext
# HG changeset patch
|
|
# Parent 548ab57454752e9575323e26d0471669c78172f6
|
|
|
|
diff --git a/controllers/my_controller.py b/controllers/my_controller.py
|
|
--- a/controllers/my_controller.py
|
|
+++ b/controllers/my_controller.py
|
|
@@ -12,6 +12,8 @@ class my_controller(main.Home):
|
|
'tas': tas,
|
|
})
|
|
|
|
- @http.route('/tas/<int:id>/', auth='public', website=True)
|
|
- def ta(self, id):
|
|
- return http.request.website.render('academy.ta', teaching_assistants[id])
|
|
+ @http.route('/tas/<model("academy.tas"):ta>/', auth='public', website=True)
|
|
+ def ta(self, ta):
|
|
+ return http.request.website.render('academy.ta', {
|
|
+ 'ta': ta,
|
|
+ })
|
|
diff --git a/views/templates.xml b/views/templates.xml
|
|
--- a/views/templates.xml
|
|
+++ b/views/templates.xml
|
|
@@ -17,7 +17,7 @@
|
|
<h2>Teaching Assistants</h2>
|
|
<ul>
|
|
<li t-foreach="tas" t-as="ta">
|
|
- <a t-att-href="url_for('/tas/%d/' % ta_index)">
|
|
+ <a t-att-href="url_for('/tas/%s/' % ta['id'])">
|
|
<t t-esc="ta['name']"/>
|
|
</a>
|
|
</li>
|
|
@@ -35,7 +35,7 @@
|
|
<div class="oe_structure"/>
|
|
<div class="oe_structure">
|
|
<div class="container">
|
|
- <h1><t t-esc="name"/></h1>
|
|
+ <h1><t t-esc="ta.name"/></h1>
|
|
</div>
|
|
</div>
|
|
<div class="oe_structure"/>
|