当前位置: 首页>>代码示例>>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;未经允许,请勿转载。