Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
1739 Lượt xem

I want to know if there is a way in Odoo to assign a base route to a controller.

By that, I mean: Imagine I have a module called "App1", with a controller offering routes for this app.

I want all my routes to start with "/app1". 

Instead of having to repeat this on every '@route' decorator of my controller, can I set it globally so every route will be prefixed with this global one?


fictional example:

@controller_route('/app1'):
class MyController(Controller):
​@route('home')
​app_home():
​# is accessible via /app1/home
Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
1
thg 3 15
3730
0
thg 3 15
4621
2
thg 8 25
2439
2
thg 6 25
808
0
thg 5 25
918