Files
odoo_source/openerp/cli/templates/default/controllers.py.template
T
Aaron Bohy 9ebfa11b8c [FIX] Packaging, Scaffolding: template files extension
Add .template as extension of the template files because RPM packaging
produces an error when trying to compile the python template files,
which contains Jinja instructions.

Include *.template files in MANIFEST.in to package them.
2015-03-02 16:38:34 +01:00

24 lines
803 B
Plaintext

{%- set mod = name|snake -%}
{%- set model = "%s.%s"|format(mod, mod) -%}
{%- set root = "/%s/%s"|format(mod, mod) -%}
# -*- coding: utf-8 -*-
from openerp import http
# class {{ mod|pascal }}(http.Controller):
# @http.route('{{ root }}/', auth='public')
# def index(self, **kw):
# return "Hello, world"
# @http.route('{{ root }}/objects/', auth='public')
# def list(self, **kw):
# return http.request.render('{{ mod }}.listing', {
# 'root': '{{ root }}',
# 'objects': http.request.env['{{ model }}'].search([]),
# })
# @http.route('{{ root }}/objects/<model("{{ model }}"):obj>/', auth='public')
# def object(self, obj, **kw):
# return http.request.render('{{ mod }}.object', {
# 'object': obj
# })