本文整理汇总了Python中odoo.http.request.render方法的典型用法代码示例。如果您正苦于以下问题:Python request.render方法的具体用法?Python request.render怎么用?Python request.render使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类odoo.http.request
的用法示例。
在下文中一共展示了request.render方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: hello
# 需要导入模块: from odoo.http import request [as 别名]
# 或者: from odoo.http.request import render [as 别名]
def hello(self,**kwargs):
return request.render('bug-website.hello')
示例2: index
# 需要导入模块: from odoo.http import request [as 别名]
# 或者: from odoo.http.request import render [as 别名]
def index(self, **kwargs):
Bugs = request.env['bm.bug']
bugs = Bugs.search([])
return request.render(
'bug-website.index',
{'bugs': bugs})
示例3: detail
# 需要导入模块: from odoo.http import request [as 别名]
# 或者: from odoo.http.request import render [as 别名]
def detail(self, bug, **kwargs):
return http.request.render(
'bug-website.detail',
{'bug': bug})
示例4: add
# 需要导入模块: from odoo.http import request [as 别名]
# 或者: from odoo.http.request import render [as 别名]
def add(self, **kwargs):
users = request.env['res.users'].search([])
return request.render(
'bug-website.add', {'users': users})
示例5: library_books
# 需要导入模块: from odoo.http import request [as 别名]
# 或者: from odoo.http.request import render [as 别名]
def library_books(self):
country_id = False
country_code = request.session.geoip and request.session.geoip.get('country_code') or False
if country_code:
country_ids = request.env['res.country'].sudo().search([('code', '=', country_code)])
if country_ids:
country_id = country_ids[0].id
domain = ['|', ('restrict_country_ids', '=', False), ('restrict_country_ids', 'not in', [country_id])]
return request.render(
'my_library.books', {
'books': request.env['library.book'].search(domain),
})
示例6: library_book_detail
# 需要导入模块: from odoo.http import request [as 别名]
# 或者: from odoo.http.request import render [as 别名]
def library_book_detail(self, book):
return request.render(
'my_library.book_detail', {
'book': book,
'main_object': book
})
示例7: books_issues
# 需要导入模块: from odoo.http import request [as 别名]
# 或者: from odoo.http.request import render [as 别名]
def books_issues(self, **post):
if post.get('book_id'):
book_id = int(post.get('book_id'))
issue_description = post.get('issue_description')
request.env['book.issue'].sudo().create({
'book_id': book_id,
'issue_description': issue_description,
'submitted_by': request.env.user.id
})
return request.redirect('/books/submit_issues?submitted=1')
return request.render('my_library.books_issue_form', {
'books': request.env['library.book'].search([]),
'submitted': post.get('submitted', False)
})
示例8: library_books
# 需要导入模块: from odoo.http import request [as 别名]
# 或者: from odoo.http.request import render [as 别名]
def library_books(self):
return request.render(
'my_library.books', {
'books': request.env['library.book'].search([]),
})
示例9: library_book_detail
# 需要导入模块: from odoo.http import request [as 别名]
# 或者: from odoo.http.request import render [as 别名]
def library_book_detail(self, book):
return request.render(
'my_library.book_detail', {
'book': book,
})
示例10: helloworld
# 需要导入模块: from odoo.http import request [as 别名]
# 或者: from odoo.http.request import render [as 别名]
def helloworld(self):
# return('<h1>Hello World!</h1>')
return request.render('library_website.helloworld')
示例11: hellocms
# 需要导入模块: from odoo.http import request [as 别名]
# 或者: from odoo.http.request import render [as 别名]
def hellocms(self, page, **kwargs):
return http.request.render(page)
示例12: checkouts
# 需要导入模块: from odoo.http import request [as 别名]
# 或者: from odoo.http.request import render [as 别名]
def checkouts(self, **kwargs):
Checkout = request.env['library.checkout']
checkouts = Checkout.search([])
return request.render(
'library_website.index',
{'docs': checkouts})
示例13: checkout
# 需要导入模块: from odoo.http import request [as 别名]
# 或者: from odoo.http.request import render [as 别名]
def checkout(self, doc, **kwargs):
return http.request.render(
'library_website.checkout',
{'doc': doc})
示例14: checkout_create
# 需要导入模块: from odoo.http import request [as 别名]
# 或者: from odoo.http.request import render [as 别名]
def checkout_create(self, **kwargs):
books = request.env['library.book'].search([])
member = request.env['library.member'].search(
[('partner_id', '=', request.env.user.partner_id.id)],
limit=1)
return request.render(
'library_website.checkout_create',
{'books': books, 'member': member})