當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。