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


Python Params.fill方法代码示例

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


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

示例1: fillresponse

# 需要导入模块: from lucterios.CORE.parameters import Params [as 别名]
# 或者: from lucterios.CORE.parameters.Params import fill [as 别名]
    def fillresponse(self):
        XferContainerCustom.fillresponse(self)
        self.new_tab(_('EMail configuration'))
        img = XferCompImage('img_conf')
        img.set_value(self.icon_path())
        img.set_location(0, 0, 1, 6)
        self.add_component(img)

        conf_params = ['mailing-smtpserver', 'mailing-smtpport',
                       'mailing-smtpsecurity', 'mailing-smtpuser', 'mailing-smtppass',
                       'mailing-delay-batch', 'mailing-nb-by-batch']
        Params.fill(self, conf_params, 1, 1)
        btn = XferCompButton('editparam')
        btn.set_location(3, 1, 1, 5)
        btn.set_action(self.request, ParamEdit.get_action(_('Modify'), 'images/edit.png'), close=CLOSE_NO, params={'params': conf_params})
        self.add_component(btn)
        if will_mail_send():
            btn = XferCompButton('tryemail')
            btn.set_location(1, 10, 2)
            btn.set_action(self.request, SendEmailTry.get_action(_('Send'), ''), close=CLOSE_NO)
            self.add_component(btn)

        self.new_tab(_('Default message'))
        img = XferCompImage('img_msg')
        img.set_value(self.icon_path())
        img.set_location(0, 0, 1, 6)
        self.add_component(img)

        msg_params = ['mailing-msg-connection']
        Params.fill(self, msg_params, 1, 1)
        btn = XferCompButton('editmsg')
        btn.set_location(1, 10, 2)
        btn.set_action(self.request, ParamEdit.get_action(_('Modify'), 'images/edit.png'), close=CLOSE_NO, params={'params': msg_params})
        self.add_component(btn)
开发者ID:Lucterios2,项目名称:contacts,代码行数:36,代码来源:views.py

示例2: test_parameters_float

# 需要导入模块: from lucterios.CORE.parameters import Params [as 别名]
# 或者: from lucterios.CORE.parameters.Params import fill [as 别名]
    def test_parameters_float(self):
        param = Parameter.objects.create(
            name='param_float', typeparam=2)
        param.args = "{'Min':20, 'Max':30, 'Prec':2}"
        param.value = '22.25'
        param.save()
        Params.fill(self.xfer, ['param_float'], 1, 1, True)
        Params.fill(self.xfer, ['param_float'], 1, 2, False)
        self.callparam()
        self.assert_count_equal('COMPONENTS/*', 4)
        self.assert_count_equal(
            'COMPONENTS/LABELFORM[@name="lbl_param_float"]', 2)
        self.assert_xml_equal(
            'COMPONENTS/LABELFORM[@name="param_float"]', '22.25')
        self.assert_xml_equal('COMPONENTS/FLOAT[@name="param_float"]', '22.25')
        self.assert_attrib_equal(
            'COMPONENTS/FLOAT[@name="param_float"]', 'min', '20.0')
        self.assert_attrib_equal(
            'COMPONENTS/FLOAT[@name="param_float"]', 'max', '30.0')
        self.assert_attrib_equal(
            'COMPONENTS/FLOAT[@name="param_float"]', 'prec', '2')

        self.factory.xfer = ParamSave()
        self.call(
            '/CORE/paramSave', {'params': 'param_float', 'param_float': '26.87'}, False)
        self.assert_observer('core.acknowledge', 'CORE', 'paramSave')
        self.assertEqual(Params.getvalue('param_float'), 26.87)
开发者ID:povtux,项目名称:core,代码行数:29,代码来源:tests_framework.py

示例3: conf_wizard_contacts

# 需要导入模块: from lucterios.CORE.parameters import Params [as 别名]
# 或者: from lucterios.CORE.parameters.Params import fill [as 别名]
def conf_wizard_contacts(wizard_ident, xfer):
    if isinstance(wizard_ident, list) and (xfer is None):
        wizard_ident.append(("contacts_current", 5))
        wizard_ident.append(("contacts_params", 40))
        wizard_ident.append(("contacts_responsable", 41))
    elif (xfer is not None) and (wizard_ident == "contacts_current"):
        xfer.add_title(_("Lucterios contacts"), _("Our details"), _('configure our details'))
        xfer.model = LegalEntity
        xfer.item = LegalEntity.objects.get(id=1)
        xfer.fill_from_model(1, xfer.get_max_row() + 1, True, desc_fields=LegalEntity.get_show_fields()[_('[email protected]')])
        xfer.remove_component('structure_type')
        btn = XferCompButton("btnconf")
        btn.set_location(2, xfer.get_max_row() + 1)
        btn.set_is_mini(True)
        btn.set_action(xfer.request, CurrentStructureAddModify.get_action('', "images/edit.png"), close=CLOSE_NO)
        xfer.add_component(btn)
    elif (xfer is not None) and (wizard_ident == "contacts_params"):
        xfer.add_title(_("Lucterios contacts"), _("Contacts configuration"), _('configure your contacts'))
        param_lists = ['contacts-mailtoconfig', 'contacts-createaccount']
        Params.fill(xfer, param_lists, 1, xfer.get_max_row() + 1)
        btn = XferCompButton('editparam')
        btn.set_location(4, xfer.get_max_row())
        btn.set_is_mini(True)
        btn.set_action(xfer.request, ParamEdit.get_action(TITLE_MODIFY, 'images/edit.png'), close=CLOSE_NO,
                       params={'params': param_lists})
        xfer.add_component(btn)
        lbl = XferCompLabelForm("nb_function")
        lbl.set_location(1, xfer.get_max_row() + 1)
        lbl.set_value(TEXT_TOTAL_NUMBER % {'name': Function._meta.verbose_name_plural, 'count': len(Function.objects.all())})
        xfer.add_component(lbl)
        lbl = XferCompLabelForm("nb_structuretype")
        lbl.set_location(1, xfer.get_max_row() + 1)
        lbl.set_value(TEXT_TOTAL_NUMBER % {'name': StructureType._meta.verbose_name_plural, 'count': len(StructureType.objects.all())})
        xfer.add_component(lbl)
        lbl = XferCompLabelForm("nb_customfield")
        lbl.set_location(1, xfer.get_max_row() + 1)
        lbl.set_value(TEXT_TOTAL_NUMBER % {'name': CustomField._meta.verbose_name_plural, 'count': len(CustomField.objects.all())})
        xfer.add_component(lbl)
        btn = XferCompButton("btnconf")
        btn.set_location(4, xfer.get_max_row() - 2, 1, 3)
        btn.set_action(xfer.request, Configuration.get_action(TITLE_MODIFY, "images/edit.png"), close=CLOSE_NO)
        xfer.add_component(btn)

        lbl = XferCompLabelForm("nb_legalentity")
        lbl.set_location(1, xfer.get_max_row() + 1)
        lbl.set_value(TEXT_TOTAL_NUMBER % {'name': LegalEntity._meta.verbose_name_plural, 'count': len(LegalEntity.objects.all())})
        xfer.add_component(lbl)
        lbl = XferCompLabelForm("nb_individual")
        lbl.set_location(1, xfer.get_max_row() + 1)
        lbl.set_value(TEXT_TOTAL_NUMBER % {'name': Individual._meta.verbose_name_plural, 'count': len(Individual.objects.all())})
        xfer.add_component(lbl)
        btn = XferCompButton("btnimport")
        btn.set_location(4, xfer.get_max_row() - 1, 1, 2)
        btn.set_action(xfer.request, ContactImport.get_action(_("Contact import"), "images/add.png"), close=CLOSE_NO, params={'step': 0})
        xfer.add_component(btn)
    elif (xfer is not None) and (wizard_ident == "contacts_responsable"):
        xfer.add_title(_("Lucterios contacts"), _('associates'), _('configure your association'))
        xfer.params['legal_entity'] = 1
        xfer.fill_grid(5, Responsability, "responsability", Responsability.objects.filter(legal_entity_id=1))
开发者ID:Lucterios2,项目名称:contacts,代码行数:61,代码来源:views.py

示例4: fill_params

# 需要导入模块: from lucterios.CORE.parameters import Params [as 别名]
# 或者: from lucterios.CORE.parameters.Params import fill [as 别名]
def fill_params(xfer, is_mini=False):
    param_lists = ['payoff-cash-account', 'payoff-bankcharges-account', 'payoff-email-message']
    Params.fill(xfer, param_lists, 1, xfer.get_max_row() + 1)
    btn = XferCompButton('editparam')
    btn.set_is_mini(is_mini)
    btn.set_location(1, xfer.get_max_row() + 1, 2, 1)
    btn.set_action(xfer.request, ParamEdit.get_action(TITLE_MODIFY, 'images/edit.png'), close=CLOSE_NO, params={'params': param_lists})
    xfer.add_component(btn)
开发者ID:Diacamma2,项目名称:financial,代码行数:10,代码来源:views_conf.py

示例5: fill_params

# 需要导入模块: from lucterios.CORE.parameters import Params [as 别名]
# 或者: from lucterios.CORE.parameters.Params import fill [as 别名]
def fill_params(xfer, is_mini=False):
    xfer.params['params'] = ['accounting-devise', 'accounting-devise-iso', 'accounting-devise-prec', 'accounting-sizecode']
    Params.fill(xfer, xfer.params['params'], 1, xfer.get_max_row() + 1)
    btn = XferCompButton('editparam')
    btn.set_is_mini(is_mini)
    btn.set_location(1, xfer.get_max_row() + 1, 2, 1)
    btn.set_action(xfer.request, ParamEdit.get_action(TITLE_MODIFY, 'images/edit.png'), close=CLOSE_NO)
    xfer.add_component(btn)
开发者ID:Diacamma2,项目名称:financial,代码行数:10,代码来源:views_admin.py

示例6: fill_params

# 需要导入模块: from lucterios.CORE.parameters import Params [as 别名]
# 或者: from lucterios.CORE.parameters.Params import fill [as 别名]
def fill_params(xfer):
    param_lists = ["event-degree-text", "event-subdegree-enable",
                   "event-subdegree-text", "event-comment-text"]
    Params.fill(xfer, param_lists, 1, xfer.get_max_row() + 1, nb_col=1)
    btn = XferCompButton('editparam')
    btn.set_location(1, xfer.get_max_row() + 1, 2, 1)
    btn.set_action(xfer.request, ParamEdit.get_action(TITLE_MODIFY, 'images/edit.png'),
                   close=CLOSE_NO, params={'params': param_lists, 'nb_col': 1})
    xfer.add_component(btn)
开发者ID:Diacamma2,项目名称:asso,代码行数:11,代码来源:views_conf.py

示例7: fillresponse

# 需要导入模块: from lucterios.CORE.parameters import Params [as 别名]
# 或者: from lucterios.CORE.parameters.Params import fill [as 别名]
 def fillresponse(self, params=(), nb_col=1):
     img_title = XferCompImage('img')
     img_title.set_location(0, 0)
     img_title.set_value(self.icon_path())
     self.add_component(img_title)
     lab = XferCompLabelForm('title')
     lab.set_location(1, 0, 2 * nb_col)
     lab.set_value_as_title(_("Edition of parameters"))
     self.add_component(lab)
     Params.fill(self, params, 1, 1, False, nb_col)
     self.add_action(ParamSave.get_action(_('Ok'), 'images/ok.png'), {})
     self.add_action(WrapAction(_('Cancel'), 'images/cancel.png'), {})
开发者ID:povtux,项目名称:core,代码行数:14,代码来源:views.py

示例8: test_parameters_bool

# 需要导入模块: from lucterios.CORE.parameters import Params [as 别名]
# 或者: from lucterios.CORE.parameters.Params import fill [as 别名]
    def test_parameters_bool(self):
        param = Parameter.objects.create(
            name='param_bool', typeparam=3)
        param.args = "{}"
        param.value = 'False'
        param.save()
        Params.fill(self.xfer, ['param_bool'], 1, 1, True)
        Params.fill(self.xfer, ['param_bool'], 1, 2, False)
        self.callparam()
        self.assert_count_equal('COMPONENTS/*', 4)
        self.assert_count_equal(
            'COMPONENTS/LABELFORM[@name="lbl_param_bool"]', 2)
        self.assert_xml_equal(
            'COMPONENTS/LABELFORM[@name="param_bool"]', 'Non')
        self.assert_xml_equal('COMPONENTS/CHECK[@name="param_bool"]', '0')

        self.factory.xfer = ParamSave()
        self.call(
            '/CORE/paramSave', {'params': 'param_bool', 'param_bool': '1'}, False)
        self.assert_observer('core.acknowledge', 'CORE', 'paramSave')
        self.assertEqual(Params.getvalue('param_bool'), True)
开发者ID:povtux,项目名称:core,代码行数:23,代码来源:tests_framework.py

示例9: test_parameters_memo

# 需要导入模块: from lucterios.CORE.parameters import Params [as 别名]
# 或者: from lucterios.CORE.parameters.Params import fill [as 别名]
    def test_parameters_memo(self):
        param = Parameter.objects.create(
            name='param_memo', typeparam=0)
        param.args = "{'Multi':True}"
        param.value = 'other value'
        param.save()
        Params.fill(self.xfer, ['param_memo'], 1, 1, True)
        Params.fill(self.xfer, ['param_memo'], 1, 2, False)
        self.callparam()
        self.assert_count_equal('COMPONENTS/*', 4)
        self.assert_count_equal(
            'COMPONENTS/LABELFORM[@name="lbl_param_memo"]', 2)
        self.assert_xml_equal(
            'COMPONENTS/LABELFORM[@name="param_memo"]', 'other value')
        self.assert_xml_equal(
            'COMPONENTS/MEMO[@name="param_memo"]', 'other value')

        self.factory.xfer = ParamSave()
        self.call(
            '/CORE/paramSave', {'params': 'param_memo', 'param_memo': 'new special value'}, False)
        self.assert_observer('core.acknowledge', 'CORE', 'paramSave')
        self.assertEqual(Params.getvalue('param_memo'), 'new special value')
开发者ID:povtux,项目名称:core,代码行数:24,代码来源:tests_framework.py

示例10: test_parameters_select

# 需要导入模块: from lucterios.CORE.parameters import Params [as 别名]
# 或者: from lucterios.CORE.parameters.Params import fill [as 别名]
    def test_parameters_select(self):
        param = Parameter.objects.create(
            name='param_select', typeparam=4)
        param.args = "{'Enum':4}"
        param.value = '2'
        param.save()
        Params.fill(self.xfer, ['param_select'], 1, 1, True)
        Params.fill(self.xfer, ['param_select'], 1, 2, False)
        self.callparam()
        self.assert_count_equal('COMPONENTS/*', 4)
        self.assert_count_equal(
            'COMPONENTS/LABELFORM[@name="lbl_param_select"]', 2)
        self.assert_xml_equal(
            'COMPONENTS/LABELFORM[@name="param_select"]', 'param_select.2')
        self.assert_xml_equal('COMPONENTS/SELECT[@name="param_select"]', '2')
        self.assert_count_equal(
            'COMPONENTS/SELECT[@name="param_select"]/CASE', 4)

        self.factory.xfer = ParamSave()
        self.call(
            '/CORE/paramSave', {'params': 'param_select', 'param_select': '1'}, False)
        self.assert_observer('core.acknowledge', 'CORE', 'paramSave')
        self.assertEqual(Params.getvalue('param_select'), 1)
开发者ID:povtux,项目名称:core,代码行数:25,代码来源:tests_framework.py

示例11: config_contacts

# 需要导入模块: from lucterios.CORE.parameters import Params [as 别名]
# 或者: from lucterios.CORE.parameters.Params import fill [as 别名]
def config_contacts(xfer):
    new_params = ['contacts-mailtoconfig', 'contacts-createaccount']
    Params.fill(xfer, new_params, 1, 10)
    xfer.params['params'].extend(new_params)
    return True
开发者ID:Lucterios2,项目名称:contacts,代码行数:7,代码来源:views.py

示例12: config_core

# 需要导入模块: from lucterios.CORE.parameters import Params [as 别名]
# 或者: from lucterios.CORE.parameters.Params import fill [as 别名]
def config_core(xfer):
    Params.fill(xfer, ['CORE-connectmode'], 1, 1)
    xfer.params['params'].append('CORE-connectmode')
开发者ID:povtux,项目名称:core,代码行数:5,代码来源:views.py


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