本文整理汇总了Python中lucterios.CORE.parameters.Params.clear方法的典型用法代码示例。如果您正苦于以下问题:Python Params.clear方法的具体用法?Python Params.clear怎么用?Python Params.clear使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类lucterios.CORE.parameters.Params
的用法示例。
在下文中一共展示了Params.clear方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: fillresponse
# 需要导入模块: from lucterios.CORE.parameters import Params [as 别名]
# 或者: from lucterios.CORE.parameters.Params import clear [as 别名]
def fillresponse(self, account_system=''):
if account_system != '':
if self.confirme(_('Do you confirm to select "%s" like accounting system?{[br/]}{[br/]}{[i]}{[u]}Warning{[/u]}: This choose is definitive.{[/i]}') %
accounting_system_name(account_system)):
Parameter.change_value('accounting-system', account_system)
Params.clear()
clear_system_account()
示例2: _params
# 需要导入模块: from lucterios.CORE.parameters import Params [as 别名]
# 或者: from lucterios.CORE.parameters.Params import clear [as 别名]
def _params(self):
cur_p = self.old_db.open()
cur_p.execute(
"SELECT paramName,value FROM CORE_extension_params WHERE extensionId LIKE 'fr_sdlibre_membres' and paramName in ('EquipeEnable', 'EquipeText', 'ActiviteEnable', 'ActiviteText', 'AgeEnable', 'LicenceEnabled', 'FiltreGenre', 'Numero', 'Naissance', 'compteTiersDefault', 'connexion')")
for param_name, param_value in cur_p.fetchall():
pname = ''
if param_name == "EquipeEnable":
pname = "member-team-enable"
if param_name == "EquipeText":
pname = "member-team-text"
if param_name == "ActiviteEnable":
pname = "member-activite-enable"
if param_name == "ActiviteText":
pname = "member-activite-text"
if param_name == "AgeEnable":
pname = "member-age-enable"
if param_name == "LicenceEnabled":
pname = "member-licence-enabled"
if param_name == "FiltreGenre":
pname = "member-filter-genre"
if param_name == "Numero":
pname = "member-numero"
if param_name == "Naissance":
pname = "member-birth"
if param_name == "compteTiersDefault":
pname = "invoice-account-third"
param_value = convert_code(param_value)
if param_name == "connexion":
pname = "member-connection"
if pname != '':
self.print_debug(
"=> parameter of invoice %s - %s", (pname, param_value))
Parameter.change_value(pname, param_value)
Params.clear()
示例3: test_connect_anonymous
# 需要导入模块: from lucterios.CORE.parameters import Params [as 别名]
# 或者: from lucterios.CORE.parameters.Params import clear [as 别名]
def test_connect_anonymous(self):
Params.clear()
self.calljson('/CORE/authentification', {'username': '', 'password': ''})
self.assert_observer('core.auth', 'CORE', 'authentification')
self.assert_json_equal('', '', 'BADAUTH')
param = Parameter.objects.get(name='CORE-connectmode')
param.value = '1'
param.save()
Params.clear()
self.calljson('/CORE/authentification', {'username': '', 'password': ''})
self.assert_observer('core.auth', 'CORE', 'authentification')
self.assert_json_equal('', '', 'OK')
self.assertEqual(self.response_json['connexion']['LOGIN'], '')
self.assertEqual(self.response_json['connexion']['REALNAME'], '')
self.assertEqual(self.response_json['connexion']['MODE'], '1')
self.calljson('/CORE/menu', {})
self.assert_observer('core.menu', 'CORE', 'menu')
self.assertEqual(len(self.response_json['menus']), 1)
self.assertEqual(self.response_json['menus'][0]['id'], 'dummy.foo')
self.assertEqual(self.response_json['menus'][0]['text'], six.text_type('Dummy'))
self.assertEqual(len(self.response_json['menus'][0]['menus']), 6)
示例4: test_payment_billpartial_with_tax
# 需要导入模块: from lucterios.CORE.parameters import Params [as 别名]
# 或者: from lucterios.CORE.parameters.Params import clear [as 别名]
def test_payment_billpartial_with_tax(self):
Parameter.change_value('invoice-vat-mode', '2')
Params.clear()
details = [
{'article': 2, 'designation': 'Article 02', 'price': '100.00', 'quantity': 1}]
self._create_bill(details, 1, '2015-04-02', 4, True)
self.factory.xfer = PayoffAddModify()
self.call(
'/diacamma.payoff/payoffAddModify', {'SAVE': 'YES', 'supporting': 6, 'amount': '60.0', 'payer': "Ma'a Dalton", 'date': '2015-04-01', 'mode': 0, 'reference': 'abc', 'bank_account': 0}, False)
self.assert_observer(
'core.acknowledge', 'diacamma.payoff', 'payoffAddModify')
self.factory.xfer = BillShow()
self.call('/diacamma.invoice/billShow', {'bill': 6}, False)
self.assert_observer(
'core.custom', 'diacamma.invoice', 'billShow')
self.assert_xml_equal(
'COMPONENTS/LABELFORM[@name="title"]', "{[br/]}{[center]}{[u]}{[b]}facture{[/b]}{[/u]}{[/center]}")
self.assert_xml_equal(
'COMPONENTS/LABELFORM[@name="status"]', "validé")
self.assert_xml_equal(
'COMPONENTS/LABELFORM[@name="total_rest_topay"]', "40.00€")
self.assert_xml_equal(
'COMPONENTS/LABELFORM[@name="vta_sum"]', "4.76€")
self.assert_count_equal('ACTIONS/ACTION', 5)
self.assert_action_equal('ACTIONS/ACTION[1]', (six.text_type(
'Règlement'), 'diacamma.payoff/images/payments.png', 'diacamma.payoff', 'payableShow', 0, 1, 1))
self.factory.xfer = PayableShow()
self.call('/diacamma.payoff/supportingPaymentMethod', {'bill': 6, 'item_name': 'bill'}, False)
self.assert_observer('core.custom', 'diacamma.payoff', 'supportingPaymentMethod')
self.assert_xml_equal('COMPONENTS/LABELFORM[@name="num_txt"]', 'A-2')
self.check_payment(6, 'facture A-2 - 2 avril 2015', '38.1', '1.9')
示例5: setUp
# 需要导入模块: from lucterios.CORE.parameters import Params [as 别名]
# 或者: from lucterios.CORE.parameters.Params import clear [as 别名]
def setUp(self):
self.factory = XmlRequestFactory(self.xfer_class, self.language)
self.client = XmlClient(self.language)
self.response = None
self.clean_resp()
Params.clear()
notfree_mode_connect()
示例6: test_params
# 需要导入模块: from lucterios.CORE.parameters import Params [as 别名]
# 或者: from lucterios.CORE.parameters.Params import clear [as 别名]
def test_params(self):
self.factory.xfer = CategoryConf()
self.call('/diacamma.member/categoryConf', {}, False)
self.assert_observer(
'core.custom', 'diacamma.member', 'categoryConf')
self.assert_count_equal('COMPONENTS/*', 37)
self.assert_count_equal('COMPONENTS/TAB', 4)
self.assert_xml_equal('COMPONENTS/TAB[1]', 'Paramètres')
self.assert_xml_equal('COMPONENTS/TAB[2]', 'Age')
self.assert_xml_equal('COMPONENTS/TAB[3]', 'Équipe')
self.assert_xml_equal('COMPONENTS/TAB[4]', 'Activité')
self.assert_xml_equal(
'COMPONENTS/LABELFORM[@name="member-team-text"]', 'Équipe')
self.assert_xml_equal(
'COMPONENTS/LABELFORM[@name="member-activite-text"]', 'Activité')
Parameter.change_value("member-team-text", 'Cours')
Parameter.change_value("member-activite-text", 'Sport')
Params.clear()
self.factory.xfer = CategoryConf()
self.call('/diacamma.member/categoryConf', {}, False)
self.assert_observer(
'core.custom', 'diacamma.member', 'categoryConf')
self.assert_count_equal('COMPONENTS/*', 37)
self.assert_count_equal('COMPONENTS/TAB', 4)
self.assert_xml_equal('COMPONENTS/TAB[1]', 'Paramètres')
self.assert_xml_equal('COMPONENTS/TAB[2]', 'Age')
self.assert_xml_equal('COMPONENTS/TAB[3]', 'Cours')
self.assert_xml_equal('COMPONENTS/TAB[4]', 'Sport')
self.assert_xml_equal(
'COMPONENTS/LABELFORM[@name="member-team-text"]', 'Cours')
self.assert_xml_equal(
'COMPONENTS/LABELFORM[@name="member-activite-text"]', 'Sport')
示例7: _params
# 需要导入模块: from lucterios.CORE.parameters import Params [as 别名]
# 或者: from lucterios.CORE.parameters.Params import clear [as 别名]
def _params(self):
cur_p = self.old_db.open()
cur_p.execute(
"SELECT paramName,value FROM CORE_extension_params WHERE extensionId LIKE 'fr_sdlibre_facture' and paramName in ('ModeTVA','DefaultCompteVente','compteTVAVente','CompteRemise','CompteFraisBank','CompteCaisse')")
for param_name, param_value in cur_p.fetchall():
pname = ''
if param_name == 'ModeTVA':
pname = 'invoice-vat-mode'
if param_value == '':
param_value = '0'
elif param_name == 'DefaultCompteVente':
pname = 'invoice-default-sell-account'
param_value = convert_code(param_value)
elif param_name == 'compteTVAVente':
pname = 'invoice-vatsell-account'
param_value = convert_code(param_value)
elif param_name == 'CompteRemise':
pname = 'invoice-reduce-account'
param_value = convert_code(param_value)
elif param_name == 'CompteFraisBank':
pname = 'payoff-bankcharges-account'
param_value = convert_code(param_value)
elif param_name == 'CompteCaisse':
pname = 'payoff-cash-account'
param_value = convert_code(param_value)
if pname != '':
self.print_debug(
"=> parameter of invoice %s - %s", (pname, param_value))
Parameter.change_value(pname, param_value)
Params.clear()
示例8: setUp
# 需要导入模块: from lucterios.CORE.parameters import Params [as 别名]
# 或者: from lucterios.CORE.parameters.Params import clear [as 别名]
def setUp(self):
self.xfer_class = XferContainerAcknowledge
self.xfer_class.url_text = "customer/details"
self.xfer_class.is_view_right = ''
LucteriosTest.setUp(self)
self.value = False
self.xfer = XferContainerCustom()
Params.clear()
示例9: default_event_params
# 需要导入模块: from lucterios.CORE.parameters import Params [as 别名]
# 或者: from lucterios.CORE.parameters.Params import clear [as 别名]
def default_event_params():
for activity in Activity.objects.all():
for level in range(1, 10):
DegreeType.objects.create(
name="level #%d.%d" % (activity.id, level), level=level, activity=activity)
for level in range(1, 6):
SubDegreeType.objects.create(
name="sublevel #%d" % level, level=level)
Parameter.change_value("event-degree-text", 'Grade')
Parameter.change_value("event-subdegree-text", 'Barette')
Parameter.change_value("event-comment-text", 'Epreuve 1:{[br/]}Epreuve 2:{[br/]}')
Params.clear()
示例10: _params
# 需要导入模块: from lucterios.CORE.parameters import Params [as 别名]
# 或者: from lucterios.CORE.parameters.Params import clear [as 别名]
def _params(self):
cur_p = self.old_db.open()
cur_p.execute(
"SELECT paramName,value FROM CORE_extension_params WHERE extensionId LIKE 'fr_sdlibre_copropriete' and paramName in ('frequenceAppel','defautCompteCopro')")
for param_name, param_value in cur_p.fetchall():
pname = ''
if param_name == 'defautCompteCopro':
pname = 'condominium-default-owner-account'
param_value = convert_code(param_value)
if pname != '':
self.print_debug(
"=> parameter of invoice %s - %s", (pname, param_value))
Parameter.change_value(pname, param_value)
Parameter.change_value('condominium-old-accounting', True)
Params.clear()
示例11: run_simple_action
# 需要导入模块: from lucterios.CORE.parameters import Params [as 别名]
# 或者: from lucterios.CORE.parameters.Params import clear [as 别名]
def run_simple_action(timetxt):
"""Run simple action"""
if timetxt is None:
Parameter.change_value('dummy-value', '')
Params.clear()
else:
value = Params.getvalue('dummy-value')
size = len(value.split('{[br/]}'))
if size >= 5:
LucteriosScheduler.remove(run_simple_action)
LucteriosScheduler.add_date(run_simple_action, datetime=datetime.now() + timedelta(seconds=20), timetxt=None)
else:
value += timetxt + "{[br/]}"
Parameter.change_value('dummy-value', value)
Params.clear()
示例12: paramchange_payoff
# 需要导入模块: from lucterios.CORE.parameters import Params [as 别名]
# 或者: from lucterios.CORE.parameters.Params import clear [as 别名]
def paramchange_payoff(params):
if 'accounting-sizecode' in params:
for bank in BankAccount.objects.all():
if bank.account_code != correct_accounting_code(bank.account_code):
bank.account_code = correct_accounting_code(bank.account_code)
bank.save()
if ('payoff-cash-account' in params) or ('accounting-sizecode' in params):
Parameter.change_value(
'payoff-cash-account', correct_accounting_code(Params.getvalue('payoff-cash-account')))
if ('payoff-bankcharges-account' in params) or ('accounting-sizecode' in params):
pvalue = Params.getvalue('payoff-bankcharges-account')
if pvalue != '':
Parameter.change_value(
'payoff-bankcharges-account', correct_accounting_code(pvalue))
Params.clear()
示例13: paramchange_invoice
# 需要导入模块: from lucterios.CORE.parameters import Params [as 别名]
# 或者: from lucterios.CORE.parameters.Params import clear [as 别名]
def paramchange_invoice(params):
invoice_params = ['invoice-default-sell-account', 'invoice-vatsell-account',
'invoice-reduce-account', 'invoice-account-third']
if 'accounting-sizecode' in params:
for param_item in invoice_params:
Parameter.change_value(
param_item, correct_accounting_code(Params.getvalue(param_item)))
Params.clear()
for art in Article.objects.all():
if art.sell_account != correct_accounting_code(art.sell_account):
art.sell_account = correct_accounting_code(art.sell_account)
art.save()
for invoice_param in invoice_params:
if invoice_param in params:
Parameter.change_value(
invoice_param, correct_accounting_code(Params.getvalue(invoice_param)))
示例14: set_parameters
# 需要导入模块: from lucterios.CORE.parameters import Params [as 别名]
# 或者: from lucterios.CORE.parameters.Params import clear [as 别名]
def set_parameters(values):
param_lists = [
"team", "activite", "age", "licence", "genre", 'numero', 'birth']
for param_item in param_lists:
if param_item == "genre":
param_name = "member-filter-genre"
elif param_item == "numero":
param_name = "member-numero"
elif param_item == "birth":
param_name = "member-birth"
else:
param_name = "member-%s-enable" % param_item
if param_item == "licence":
param_name += 'd'
Parameter.change_value(param_name, param_item in values)
Params.clear()
示例15: test_connect_free
# 需要导入模块: from lucterios.CORE.parameters import Params [as 别名]
# 或者: from lucterios.CORE.parameters.Params import clear [as 别名]
def test_connect_free(self):
Params.clear()
self.calljson('/CORE/authentification', {'username': '', 'password': ''})
self.assert_observer('core.auth', 'CORE', 'authentification')
self.assert_json_equal('', '', 'BADAUTH')
param = Parameter.objects.get(name='CORE-connectmode')
param.value = '2'
param.save()
Params.clear()
self.calljson('/CORE/authentification', {'username': '', 'password': ''})
self.assert_observer('core.auth', 'CORE', 'authentification')
self.assert_json_equal('', '', 'OK')
self.assertEqual(self.response_json['connexion']['LOGIN'], '')
self.assertEqual(self.response_json['connexion']['REALNAME'], '')
self.assertEqual(self.response_json['connexion']['MODE'], '2')
self.assertTrue(WrapAction.mode_connect_notfree is not None, "mode_connect_notfree is not None")
self.assertFalse(WrapAction('', '').mode_connect_notfree(), "mode_connect_notfree()")
self.assertFalse(WrapAction.mode_connect_notfree is None or WrapAction('', '').mode_connect_notfree(), "mode_connect_notfree is None or mode_connect_notfree()")
request = RequestFactory().post('/')
request.user = AnonymousUser()
act1 = WrapAction('free', 'free', is_view_right=None)
self.assertEqual(act1.is_view_right, None, 'act1.is_view_right')
self.assertFalse(act1.check_permission(request), 'check_permission None')
act2 = WrapAction('free', 'free', is_view_right='CORE.change_parameter')
act2.with_log = True
self.assertEqual(act2.is_view_right, 'CORE.change_parameter', 'act2.is_view_right')
self.assertTrue(act2.check_permission(request), 'check_permission CORE.change_parameter')
self.calljson('/CORE/configuration', {})
self.assert_observer('core.custom', 'CORE', 'configuration')
self.assert_json_equal('LABELFORM', "CORE-connectmode", "Accès libre")
self.calljson('/CORE/menu', {})
self.assert_observer('core.menu', 'CORE', 'menu')
self.assertEqual(len(self.response_json['menus']), 3)
self.assertEqual(self.response_json['menus'][0]['id'], 'core.menu')
self.assertEqual(self.response_json['menus'][1]['id'], 'dummy.foo')
self.assertEqual(len(self.response_json['menus'][1]['menus']), 9)
self.assertEqual(self.response_json['menus'][2]['id'], 'core.admin')
self.assertEqual(self.response_json['menus'][2]['text'], 'Administration')
self.assertEqual(self.response_json['menus'][2]['menus'][3]['id'], 'core.right')
self.assertEqual(self.response_json['menus'][2]['menus'][3]['text'], 'Gestion des droits')
self.assertEqual(self.response_json['menus'][2]['menus'][3]['menus'][0]['id'], 'CORE/groupsList')
self.assertEqual(self.response_json['menus'][2]['menus'][3]['menus'][0]['text'], 'Les groupes')