當前位置: 首頁>>代碼示例>>Python>>正文


Python InvoiceInterface.get_url方法代碼示例

本文整理匯總了Python中corehq.apps.accounting.interface.InvoiceInterface.get_url方法的典型用法代碼示例。如果您正苦於以下問題:Python InvoiceInterface.get_url方法的具體用法?Python InvoiceInterface.get_url怎麽用?Python InvoiceInterface.get_url使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在corehq.apps.accounting.interface.InvoiceInterface的用法示例。


在下文中一共展示了InvoiceInterface.get_url方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: post

# 需要導入模塊: from corehq.apps.accounting.interface import InvoiceInterface [as 別名]
# 或者: from corehq.apps.accounting.interface.InvoiceInterface import get_url [as 別名]
 def post(self, request, *args, **kwargs):
     if 'adjust' in self.request.POST:
         if self.adjust_balance_form.is_valid():
             self.adjust_balance_form.adjust_balance(
                 web_user=self.request.user.username,
             )
             return HttpResponseRedirect(request.META.get('HTTP_REFERER') or self.page_url)
     elif 'resend' in self.request.POST:
         if self.resend_email_form.is_valid():
             try:
                 self.resend_email_form.resend_email()
                 return HttpResponseRedirect(self.page_url)
             except Exception as e:
                 messages.error(request,
                                "Could not send emails due to: %s" % e)
     elif SuppressInvoiceForm.submit_kwarg in self.request.POST:
         if self.suppress_invoice_form.is_valid():
             self.suppress_invoice_form.suppress_invoice()
             if self.invoice.is_customer_invoice:
                 return HttpResponseRedirect(CustomerInvoiceInterface.get_url())
             else:
                 return HttpResponseRedirect(InvoiceInterface.get_url())
     elif HideInvoiceForm.submit_kwarg in self.request.POST:
         if self.hide_invoice_form.is_valid():
             self.hide_invoice_form.hide_invoice()
     return self.get(request, *args, **kwargs)
開發者ID:kkrampa,項目名稱:commcare-hq,代碼行數:28,代碼來源:views.py

示例2: invoice_context

# 需要導入模塊: from corehq.apps.accounting.interface import InvoiceInterface [as 別名]
# 或者: from corehq.apps.accounting.interface.InvoiceInterface import get_url [as 別名]
    def invoice_context(self):
        subscriber_domain = self.subscription.subscriber.domain

        invoice_report = InvoiceInterface(self.request)
        invoice_report.filters.update(subscription__subscriber__domain=subscriber_domain)
        # Tied to InvoiceInterface.
        encoded_params = urlencode({'subscriber': subscriber_domain})
        invoice_report_url = "{}?{}".format(invoice_report.get_url(), encoded_params)
        invoice_export_url = "{}?{}".format(invoice_report.get_url(render_as='export'), encoded_params)
        return {
            'invoice_headers': invoice_report.headers,
            'invoice_rows': invoice_report.rows,
            'invoice_export_url': invoice_export_url,
            'invoice_report_url': invoice_report_url,
            'adjust_balance_forms': invoice_report.adjust_balance_forms,
        }
開發者ID:bazuzi,項目名稱:commcare-hq,代碼行數:18,代碼來源:views.py

示例3: parent_pages

# 需要導入模塊: from corehq.apps.accounting.interface import InvoiceInterface [as 別名]
# 或者: from corehq.apps.accounting.interface.InvoiceInterface import get_url [as 別名]
 def parent_pages(self):
     return [{"title": InvoiceInterface.name, "url": InvoiceInterface.get_url()}]
開發者ID:kkrampa,項目名稱:commcare-hq,代碼行數:4,代碼來源:views.py


注:本文中的corehq.apps.accounting.interface.InvoiceInterface.get_url方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。