# HG changeset patch # Parent 2edbac8244a982055a6786c14ee41719ea5410e8 diff --git a/__openerp__.py b/__openerp__.py --- a/__openerp__.py +++ b/__openerp__.py @@ -16,7 +16,10 @@ # any module necessary for this one to work correctly 'depends': ['web'], - 'data': ['security/ir.model.access.csv'], + 'data': [ + 'security/ir.model.access.csv', + 'views/templates.xml', + ], 'tests': [ ], } diff --git a/controllers/academy.py b/controllers/academy.py --- a/controllers/academy.py +++ b/controllers/academy.py @@ -14,34 +14,17 @@ teaching_assistants = [ class academy(main.Home): @http.route('/', auth='none') def index(self): + cr, uid, context = http.request.cr, http.request.uid, http.request.context tas = [ '
  • %s
  • ' % (i, ta['name']) for i, ta in enumerate(teaching_assistants) ] - return """ - - -

    Introduction to something

    -

    Teaching Assistants

    - - -""" % { - 'tas': '\n'.join(tas) - } - + return http.request.registry['ir.ui.view'].render(cr, uid, 'academy.index', { + 'tas': '\n'.join(tas) + }, context=context) @http.route('/tas//', auth='none') def ta(self, id): - return """ - - - AcademyAcademy TA %(name)s - - - -

    %(name)s

    - - -""" % teaching_assistants[id] + cr, uid, context = http.request.cr, http.request.uid, http.request.context + return http.request.registry['ir.ui.view'].render( + cr, uid, 'academy.ta', teaching_assistants[id], context=context) diff --git a/views/templates.xml b/views/templates.xml new file mode 100644 --- /dev/null +++ b/views/templates.xml @@ -0,0 +1,39 @@ + + + + + + + +