当前位置: 首页>>代码示例>>Python>>正文


Python request.render方法代码示例

本文整理汇总了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') 
开发者ID:ScottAI,项目名称:Odoo-Python-ERP-,代码行数:4,代码来源:main.py

示例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}) 
开发者ID:ScottAI,项目名称:Odoo-Python-ERP-,代码行数:8,代码来源:main.py

示例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}) 
开发者ID:ScottAI,项目名称:Odoo-Python-ERP-,代码行数:6,代码来源:main.py

示例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}) 
开发者ID:ScottAI,项目名称:Odoo-Python-ERP-,代码行数:6,代码来源:main.py

示例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),
            }) 
开发者ID:PacktPublishing,项目名称:Odoo-12-Development-Cookbook-Third-Edition,代码行数:14,代码来源:main.py

示例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
            }) 
开发者ID:PacktPublishing,项目名称:Odoo-12-Development-Cookbook-Third-Edition,代码行数:8,代码来源:main.py

示例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)
        }) 
开发者ID:PacktPublishing,项目名称:Odoo-12-Development-Cookbook-Third-Edition,代码行数:17,代码来源:main.py

示例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([]),
            }) 
开发者ID:PacktPublishing,项目名称:Odoo-12-Development-Cookbook-Third-Edition,代码行数:7,代码来源:main.py

示例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,
            }) 
开发者ID:PacktPublishing,项目名称:Odoo-12-Development-Cookbook-Third-Edition,代码行数:7,代码来源:main.py

示例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') 
开发者ID:PacktPublishing,项目名称:Odoo-12-Development-Essentials-Fourth-Edition,代码行数:5,代码来源:hello.py

示例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) 
开发者ID:PacktPublishing,项目名称:Odoo-12-Development-Essentials-Fourth-Edition,代码行数:4,代码来源:hello.py

示例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}) 
开发者ID:PacktPublishing,项目名称:Odoo-12-Development-Essentials-Fourth-Edition,代码行数:8,代码来源:main.py

示例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}) 
开发者ID:PacktPublishing,项目名称:Odoo-12-Development-Essentials-Fourth-Edition,代码行数:6,代码来源:main.py

示例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}) 
开发者ID:PacktPublishing,项目名称:Odoo-12-Development-Essentials-Fourth-Edition,代码行数:10,代码来源:main.py


注:本文中的odoo.http.request.render方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。