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


Python XferCompLabelForm.with_hypertext方法代码示例

本文整理汇总了Python中lucterios.framework.xfercomponents.XferCompLabelForm.with_hypertext方法的典型用法代码示例。如果您正苦于以下问题:Python XferCompLabelForm.with_hypertext方法的具体用法?Python XferCompLabelForm.with_hypertext怎么用?Python XferCompLabelForm.with_hypertext使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在lucterios.framework.xfercomponents.XferCompLabelForm的用法示例。


在下文中一共展示了XferCompLabelForm.with_hypertext方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: fillresponse

# 需要导入模块: from lucterios.framework.xfercomponents import XferCompLabelForm [as 别名]
# 或者: from lucterios.framework.xfercomponents.XferCompLabelForm import with_hypertext [as 别名]
    def fillresponse(self, item_name='', subject='', message='', model=0, withpayment=False):
        if item_name != '':
            self.item = Supporting.objects.get(id=self.getparam(item_name, 0))
        self.item = self.item.get_final_child()
        if self.getparam("OK") is None:
            dlg = self.create_custom()
            icon = XferCompImage('img')
            icon.set_location(0, 0, 1, 6)
            icon.set_value(self.icon_path())
            dlg.add_component(icon)
            lbl = XferCompLabelForm('lb_subject')
            lbl.set_value_as_name(_('subject'))
            lbl.set_location(1, 1)
            dlg.add_component(lbl)
            lbl = XferCompEdit('subject')
            lbl.set_value(six.text_type(self.item))
            lbl.set_location(2, 1)
            dlg.add_component(lbl)
            lbl = XferCompLabelForm('lb_message')
            lbl.set_value_as_name(_('message'))
            lbl.set_location(1, 2)
            dlg.add_component(lbl)
            contact = self.item.third.contact.get_final_child()
            lbl = XferCompMemo('message')
            lbl.set_value(Params.getvalue('payoff-email-message') % {
                          'name': contact.get_presentation(), 'doc': self.item.get_docname()})
            lbl.with_hypertext = True
            lbl.set_size(130, 450)
            lbl.set_location(2, 2)
            dlg.add_component(lbl)
            selectors = PrintModel.get_print_selector(
                2, self.item.__class__)[0]
            lbl = XferCompLabelForm('lb_model')
            lbl.set_value_as_name(selectors[1])
            lbl.set_location(1, 3)
            dlg.add_component(lbl)
            sel = XferCompSelect('model')
            sel.set_select(selectors[2])
            sel.set_location(2, 3)
            dlg.add_component(sel)

            if self.item.payoff_have_payment() and (len(PaymentMethod.objects.all()) > 0):
                lbl = XferCompLabelForm('lb_withpayment')
                lbl.set_value_as_name(_('add payment methods in email'))
                lbl.set_location(1, 4)
                dlg.add_component(lbl)
                sel = XferCompCheck('withpayment')
                sel.set_value(True)
                sel.set_location(2, 4)
                dlg.add_component(sel)

            dlg.add_action(self.get_action(TITLE_OK, 'images/ok.png'), params={"OK": "YES"})
            dlg.add_action(WrapAction(TITLE_CANCEL, 'images/cancel.png'))
        else:
            html_message = "<html>"
            html_message += message.replace('{[newline]}', '<br/>\n').replace('{[', '<').replace(']}', '>')
            if self.item.payoff_have_payment() and withpayment:
                html_message += get_html_payment(self.request.META.get('HTTP_REFERER', self.request.build_absolute_uri()), self.language, self.item)
            html_message += "</html>"
            self.item.send_email(subject, html_message, model)
开发者ID:Diacamma2,项目名称:financial,代码行数:62,代码来源:views.py


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