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


Python XferCompLabelForm.set_location方法代码示例

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


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

示例1: _entryline_editor

# 需要导入模块: from lucterios.framework.xfercomponents import XferCompLabelForm [as 别名]
# 或者: from lucterios.framework.xfercomponents.XferCompLabelForm import set_location [as 别名]
 def _entryline_editor(self, xfer, serial_vals, debit_rest, credit_rest):
     last_row = xfer.get_max_row() + 5
     lbl = XferCompLabelForm('sep1')
     lbl.set_location(0, last_row, 6)
     lbl.set_value("{[center]}{[hr/]}{[/center]}")
     xfer.add_component(lbl)
     lbl = XferCompLabelForm('sep2')
     lbl.set_location(1, last_row + 1, 5)
     lbl.set_value_center(_("Add a entry line"))
     xfer.add_component(lbl)
     entry_line = EntryLineAccount()
     entry_line.editor.edit_line(xfer, 0, last_row + 2, debit_rest, credit_rest)
     if entry_line.has_account:
         btn = XferCompButton('entrybtn')
         btn.set_location(3, last_row + 5)
         btn.set_action(xfer.request, ActionsManage.get_action_url(
             'accounting.EntryLineAccount', 'Add', xfer), close=CLOSE_YES)
         xfer.add_component(btn)
     self.item.editor.show(xfer)
     grid_lines = xfer.get_components('entrylineaccount')
     xfer.remove_component('entrylineaccount')
     new_grid_lines = XferCompGrid('entrylineaccount_serial')
     new_grid_lines.set_model(self.item.get_entrylineaccounts(serial_vals), None, xfer)
     new_grid_lines.set_location(grid_lines.col, grid_lines.row, grid_lines.colspan + 2, grid_lines.rowspan)
     new_grid_lines.add_action_notified(xfer, EntryLineAccount)
     xfer.add_component(new_grid_lines)
     nb_lines = len(new_grid_lines.record_ids)
     return nb_lines
开发者ID:Diacamma2,项目名称:financial,代码行数:30,代码来源:editors.py

示例2: show_third

# 需要导入模块: from lucterios.framework.xfercomponents import XferCompLabelForm [as 别名]
# 或者: from lucterios.framework.xfercomponents.XferCompLabelForm import set_location [as 别名]
    def show_third(self, xfer, right=""):
        xfer.params["supporting"] = self.item.id
        third = xfer.get_components("third")
        third.colspan -= 2
        if WrapAction.is_permission(xfer.request, right):
            btn = XferCompButton("change_third")
            btn.set_location(third.col + third.colspan, third.row)
            btn.set_action(
                xfer.request,
                ActionsManage.get_action_url("payoff.Supporting", "Third", xfer),
                modal=FORMTYPE_MODAL,
                close=CLOSE_NO,
                params={"code_mask": self.item.get_third_mask()},
            )
            xfer.add_component(btn)

        if self.item.third is not None:
            btn = XferCompButton("show_third")
            btn.set_is_mini(True)
            btn.set_location(third.col + third.colspan + 1, third.row)
            btn.set_action(
                xfer.request,
                ActionsManage.get_action_url("accounting.Third", "Show", xfer),
                modal=FORMTYPE_MODAL,
                close=CLOSE_NO,
                params={"third": self.item.third.id},
            )
            xfer.add_component(btn)
        lbl = XferCompLabelForm("info")
        lbl.set_color("red")
        lbl.set_location(1, xfer.get_max_row() + 1, 4)
        lbl.set_value(self.item.get_info_state())
        xfer.add_component(lbl)
开发者ID:Diacamma2,项目名称:financial,代码行数:35,代码来源:editors.py

示例3: edit

# 需要导入模块: from lucterios.framework.xfercomponents import XferCompLabelForm [as 别名]
# 或者: from lucterios.framework.xfercomponents.XferCompLabelForm import set_location [as 别名]
 def edit(self, xfer):
     xfer.change_to_readonly('type_of_account')
     code_ed = xfer.get_components('code')
     code_ed.mask = current_system_account().get_general_mask()
     code_ed.set_action(xfer.request, xfer.get_action(), modal=FORMTYPE_REFRESH, close=CLOSE_NO)
     descript, typeaccount = current_system_account().new_charts_account(self.item.code)
     error_msg = ''
     if typeaccount < 0:
         if typeaccount == -2:
             error_msg = _("Invalid code")
         if self.item.code != '':
             code_ed.set_value(self.item.code + '!')
         if self.item.id is None:
             xfer.get_components('type_of_account').set_value('---')
     elif self.item.id is None:
         field_type = self.item.get_field_by_name('type_of_account')
         xfer.get_components('type_of_account').set_value(
             get_value_if_choices(typeaccount, field_type))
         xfer.get_components('name').set_value(descript)
         xfer.params['type_of_account'] = typeaccount
     elif typeaccount != self.item.type_of_account:
         error_msg = _("Changment not allowed!")
         code_ed.set_value(self.item.code + '!')
     lbl = XferCompLabelForm('error_code')
     lbl.set_location(1, xfer.get_max_row() + 1, 2)
     lbl.set_value_center("{[font color='red']}%s{[/font]}" % error_msg)
     xfer.add_component(lbl)
     return
开发者ID:Diacamma2,项目名称:financial,代码行数:30,代码来源:editors.py

示例4: fillresponse_header

# 需要导入模块: from lucterios.framework.xfercomponents import XferCompLabelForm [as 别名]
# 或者: from lucterios.framework.xfercomponents.XferCompLabelForm import set_location [as 别名]
 def fillresponse_header(self):
     self.new_tab(_('Fiscal year list'))
     lbl = XferCompLabelForm('lbl_account_system')
     lbl.set_value_as_name(_('accounting system'))
     lbl.set_location(0, 1)
     self.add_component(lbl)
     select_account_system(self)
开发者ID:Diacamma2,项目名称:financial,代码行数:9,代码来源:views_admin.py

示例5: show

# 需要导入模块: from lucterios.framework.xfercomponents import XferCompLabelForm [as 别名]
# 或者: from lucterios.framework.xfercomponents.XferCompLabelForm import set_location [as 别名]
 def show(self, xfer):
     if xfer.item.cost_accounting is None:
         xfer.remove_component("cost_accounting")
         xfer.remove_component("lbl_cost_accounting")
     xfer.params['new_account'] = Params.getvalue('invoice-account-third')
     xfer.move(0, 0, 1)
     lbl = XferCompLabelForm('title')
     lbl.set_location(1, 0, 4)
     lbl.set_value_as_title(get_value_if_choices(
         self.item.bill_type, self.item.get_field_by_name('bill_type')))
     xfer.add_component(lbl)
     details = xfer.get_components('detail')
     if Params.getvalue("invoice-vat-mode") != 0:
         if Params.getvalue("invoice-vat-mode") == 1:
             details.headers[2] = XferCompHeader(details.headers[2].name, _(
                 'price excl. taxes'), details.headers[2].type, details.headers[2].orderable)
             details.headers[6] = XferCompHeader(details.headers[6].name, _(
                 'total excl. taxes'), details.headers[6].type, details.headers[6].orderable)
         elif Params.getvalue("invoice-vat-mode") == 2:
             details.headers[2] = XferCompHeader(details.headers[2].name, _(
                 'price incl. taxes'), details.headers[2].type, details.headers[2].orderable)
             details.headers[6] = XferCompHeader(details.headers[6].name, _(
                 'total incl. taxes'), details.headers[6].type, details.headers[6].orderable)
         xfer.get_components('lbl_total_excltax').set_value_as_name(
             _('total excl. taxes'))
         xfer.filltab_from_model(1, xfer.get_max_row() + 1, True,
                                 [((_('VTA sum'), 'vta_sum'), (_('total incl. taxes'), 'total_incltax'))])
     if self.item.status == 0:
         SupportingEditor.show_third(self, xfer, 'invoice.add_bill')
     else:
         SupportingEditor.show_third_ex(self, xfer)
         details.actions = []
         if self.item.bill_type != 0:
             SupportingEditor.show(self, xfer)
     return
开发者ID:Diacamma2,项目名称:financial,代码行数:37,代码来源:editors.py

示例6: conf_wizard_accounting

# 需要导入模块: from lucterios.framework.xfercomponents import XferCompLabelForm [as 别名]
# 或者: from lucterios.framework.xfercomponents.XferCompLabelForm import set_location [as 别名]
def conf_wizard_accounting(wizard_ident, xfer):
    if isinstance(wizard_ident, list) and (xfer is None):
        wizard_ident.append(("accounting_params", 21))
        wizard_ident.append(("accounting_fiscalyear", 22))
        wizard_ident.append(("accounting_journal", 23))
    elif (xfer is not None) and (wizard_ident == "accounting_params"):
        xfer.add_title(_("Diacamma accounting"), _('Parameters'), _('Configuration of accounting parameters'))
        select_account_system(xfer)
        fill_params(xfer, True)
    elif (xfer is not None) and (wizard_ident == "accounting_fiscalyear"):
        xfer.add_title(_("Diacamma accounting"), _('Fiscal year list'), _('Configuration of fiscal years'))
        xfer.fill_grid(5, FiscalYear, 'fiscalyear', FiscalYear.objects.all())
        try:
            current_year = FiscalYear.get_current()
            nb_account = len(ChartsAccount.objects.filter(year=current_year))
            lbl = XferCompLabelForm('nb_account')
            lbl.set_value(_("Total of charts of accounts in current fiscal year: %d") % nb_account)
            lbl.set_location(0, 10)
            xfer.add_component(lbl)
            if nb_account == 0:
                xfer.item = ChartsAccount()
                xfer.item.year = current_year
                btn = XferCompButton('initialfiscalyear')
                btn.set_location(1, 10)
                btn.set_action(xfer.request, ActionsManage.get_action_url(ChartsAccount.get_long_name(), 'AccountInitial', xfer), close=CLOSE_NO)
                xfer.add_component(btn)
        except LucteriosException as lerr:
            lbl = XferCompLabelForm('nb_account')
            lbl.set_value(six.text_type(lerr))
            lbl.set_location(0, 10, 2)
            xfer.add_component(lbl)
    elif (xfer is not None) and (wizard_ident == "accounting_journal"):
        xfer.add_title(_("Diacamma accounting"), _('Journals'), _('Configuration of journals'))
        xfer.fill_grid(5, Journal, 'journal', Journal.objects.all())
开发者ID:Diacamma2,项目名称:financial,代码行数:36,代码来源:views_admin.py

示例7: fillresponse

# 需要导入模块: from lucterios.framework.xfercomponents import XferCompLabelForm [as 别名]
# 或者: from lucterios.framework.xfercomponents.XferCompLabelForm import set_location [as 别名]
 def fillresponse(self, year=0):
     current_year = FiscalYear.objects.get(id=year)
     if self.getparam("CONFIRME") is None:
         nb_entry_noclose = current_year.check_to_close()
         text_confirm = six.text_type(_('close-fiscal-year-confirme'))
         if nb_entry_noclose > 0:
             if nb_entry_noclose == 1:
                 text_confirm += six.text_type(_('warning, entry no validated'))
             else:
                 text_confirm += six.text_type(_('warning, %d entries no validated') % nb_entry_noclose)
         dlg = self.create_custom(self.model)
         img = XferCompImage('img')
         img.set_value(self.icon_path())
         img.set_location(0, 0)
         dlg.add_component(img)
         lbl = XferCompLabelForm('title')
         lbl.set_value_as_title(self.caption)
         lbl.set_location(1, 0)
         dlg.add_component(lbl)
         lab = XferCompLabelForm('info')
         lab.set_value(text_confirm)
         lab.set_location(0, 1, 4)
         dlg.add_component(lab)
         signal_and_lock.Signal.call_signal("finalize_year", dlg)
         dlg.add_action(self.get_action(TITLE_OK, 'images/ok.png'), modal=FORMTYPE_MODAL, close=CLOSE_YES, params={'CONFIRME': 'YES'})
         dlg.add_action(WrapAction(TITLE_CANCEL, 'images/cancel.png'))
     else:
         signal_and_lock.Signal.call_signal("finalize_year", self)
         current_year.closed()
开发者ID:Diacamma2,项目名称:financial,代码行数:31,代码来源:views_accounts.py

示例8: _create_custom_for_profit

# 需要导入模块: from lucterios.framework.xfercomponents import XferCompLabelForm [as 别名]
# 或者: from lucterios.framework.xfercomponents.XferCompLabelForm import set_location [as 别名]
 def _create_custom_for_profit(self, year, custom, val_profit):
     from lucterios.framework.xfercomponents import XferCompImage, XferCompLabelForm, XferCompSelect
     from diacamma.accounting.models import format_devise
     if val_profit > 0.0001:
         type_profit = 'bénéfice'
     else:
         type_profit = 'déficite'
     img = XferCompImage("img")
     img.set_location(0, 0)
     img.set_value(get_icon_path("diacamma.accounting/images/account.png"))
     custom.add_component(img)
     lbl = XferCompLabelForm("title")
     lbl.set_value_as_headername("Bénéfices et Pertes")
     lbl.set_location(1, 0)
     custom.add_component(lbl)
     text = "{[i]}Vous avez un %s de %s.{[br/]}Vous devez definir sur quel compte l'affecter.{[br/]}{[/i]}" % (
         type_profit, format_devise(val_profit, 4))
     text += "{[br/]}En validant, vous commencerez '%s'{[br/]}{[br/]}{[i]}{[u]}Attention:{[/u]} Votre report à nouveau doit être totalement fait.{[/i]}" % six.text_type(
         year)
     lbl = XferCompLabelForm("info")
     lbl.set_value(text)
     lbl.set_location(0, 1, 2)
     custom.add_component(lbl)
     sel_cmpt = []
     for account in year.chartsaccount_set.all().filter(code__startswith='10').order_by('code'):
         sel_cmpt.append((account.id, six.text_type(account)))
     sel = XferCompSelect("profit_account")
     sel.set_select(sel_cmpt)
     sel.set_location(1, 2)
     custom.add_component(sel)
     return custom
开发者ID:Diacamma2,项目名称:financial,代码行数:33,代码来源:french.py

示例9: edit_account_for_line

# 需要导入模块: from lucterios.framework.xfercomponents import XferCompLabelForm [as 别名]
# 或者: from lucterios.framework.xfercomponents.XferCompLabelForm import set_location [as 别名]
    def edit_account_for_line(self, xfer, column, row, debit_rest, credit_rest):
        num_cpt_txt = xfer.getparam('num_cpt_txt', '')
        num_cpt = xfer.getparam('num_cpt', 0)

        lbl = XferCompLabelForm('numCptlbl')
        lbl.set_location(column, row, 3)
        lbl.set_value_as_headername(_('account'))
        xfer.add_component(lbl)
        edt = XferCompEdit('num_cpt_txt')
        edt.set_location(column, row + 1, 2)
        edt.set_value(num_cpt_txt)
        edt.set_size(20, 25)
        edt.set_action(xfer.request, xfer.get_action(), close=CLOSE_NO, modal=FORMTYPE_REFRESH)
        xfer.add_component(edt)
        sel_val = []
        current_account = None
        if num_cpt_txt != '':
            year = FiscalYear.get_current(xfer.getparam('year'))
            sel_val, current_account = year.get_account_list(num_cpt_txt, num_cpt)
        sel = XferCompSelect('num_cpt')
        sel.set_location(column + 2, row + 1, 1)
        sel.set_select(sel_val)
        sel.set_size(20, 150)
        sel.set_action(xfer.request, xfer.get_action(), close=CLOSE_NO, modal=FORMTYPE_REFRESH)
        if current_account is not None:
            sel.set_value(current_account.id)
            self.item.account = current_account
            self.item.set_montant(
                float(xfer.getparam('debit_val', 0.0)), float(xfer.getparam('credit_val', 0.0)))
            if abs(self.item.amount) < 0.0001:
                self.item.set_montant(debit_rest, credit_rest)
        xfer.add_component(sel)
        return lbl, edt
开发者ID:Diacamma2,项目名称:financial,代码行数:35,代码来源:editors.py

示例10: fillresponse_header

# 需要导入模块: from lucterios.framework.xfercomponents import XferCompLabelForm [as 别名]
# 或者: from lucterios.framework.xfercomponents.XferCompLabelForm import set_location [as 别名]
    def fillresponse_header(self):
        status_filter = self.getparam('status_filter', 0)
        self.params['status_filter'] = status_filter
        date_filter = self.getparam('date_filter', 0)
        self.fieldnames = Expense.get_default_fields(status_filter)
        lbl = XferCompLabelForm('lbl_status_filter')
        lbl.set_value_as_name(_('Filter by type'))
        lbl.set_location(0, 3)
        self.add_component(lbl)
        dep_field = self.item.get_field_by_name('status')
        sel_list = list(dep_field.choices)
        edt = XferCompSelect("status_filter")
        edt.set_select(sel_list)
        edt.set_value(status_filter)
        edt.set_location(1, 3)
        edt.set_action(self.request, self.get_action(), modal=FORMTYPE_REFRESH, close=CLOSE_NO)
        self.add_component(edt)

        lbl = XferCompLabelForm('lbl_date_filter')
        lbl.set_value_as_name(_('Filter by date'))
        lbl.set_location(0, 4)
        self.add_component(lbl)
        edt = XferCompSelect("date_filter")
        edt.set_select([(0, _('only current fiscal year')), (1, _('all expenses'))])
        edt.set_value(date_filter)
        edt.set_location(1, 4)
        edt.set_action(self.request, self.get_action(), modal=FORMTYPE_REFRESH, close=CLOSE_NO)
        self.add_component(edt)

        self.filter = Q(status=status_filter)
        if date_filter == 0:
            current_year = FiscalYear.get_current()
            self.filter &= Q(date__gte=current_year.begin) & Q(date__lte=current_year.end)
开发者ID:Diacamma2,项目名称:syndic,代码行数:35,代码来源:views_expense.py

示例11: fillresponse

# 需要导入模块: from lucterios.framework.xfercomponents import XferCompLabelForm [as 别名]
# 或者: from lucterios.framework.xfercomponents.XferCompLabelForm import set_location [as 别名]
    def fillresponse(self, begin_date, end_date):
        self.item.set_dates(begin_date, end_date)
        lbl = XferCompLabelForm('lbl_begin_date')
        lbl.set_value_as_name(_('initial date'))
        lbl.set_location(1, 0)
        self.add_component(lbl)
        date_init = XferCompDate("begin_date")
        date_init.set_needed(True)
        date_init.set_value(self.item.date_begin)
        date_init.set_location(2, 0)
        date_init.set_action(self.request, self.get_action(), close=CLOSE_NO, modal=FORMTYPE_REFRESH)
        self.add_component(date_init)
        lbl = XferCompLabelForm('lbl_end_date')
        lbl.set_value_as_name(_('current date'))
        lbl.set_location(3, 0)
        self.add_component(lbl)
        date_end = XferCompDate("end_date")
        date_end.set_needed(True)
        date_end.set_value(self.item.date_end)
        date_end.set_location(4, 0)
        date_end.set_action(self.request, self.get_action(), close=CLOSE_NO, modal=FORMTYPE_REFRESH)
        self.add_component(date_end)

        XferShowEditor.fillresponse(self)
        self.add_action(ActionsManage.get_action_url('payoff.Supporting', 'Show', self),
                        close=CLOSE_NO, params={'item_name': self.field_id}, pos_act=0)
        self.add_action(ActionsManage.get_action_url('payoff.Supporting', 'Email', self),
                        close=CLOSE_NO, params={'item_name': self.field_id}, pos_act=0)
开发者ID:Diacamma2,项目名称:syndic,代码行数:30,代码来源:views.py

示例12: summary_accounting

# 需要导入模块: from lucterios.framework.xfercomponents import XferCompLabelForm [as 别名]
# 或者: from lucterios.framework.xfercomponents.XferCompLabelForm import set_location [as 别名]
def summary_accounting(xfer):
    if WrapAction.is_permission(xfer.request, 'accounting.change_chartsaccount'):
        row = xfer.get_max_row() + 1
        lab = XferCompLabelForm('accountingtitle')
        lab.set_value_as_infocenter(_("Bookkeeping"))
        lab.set_location(0, row, 4)
        xfer.add_component(lab)
        try:
            year = FiscalYear.get_current()
            lbl = XferCompLabelForm("accounting_year")
            lbl.set_value_center(six.text_type(year))
            lbl.set_location(0, row + 1, 4)
            xfer.add_component(lbl)
            lbl = XferCompLabelForm("accounting_result")
            lbl.set_value_center(year.total_result_text)
            lbl.set_location(0, row + 2, 4)
            xfer.add_component(lbl)
        except LucteriosException as lerr:
            lbl = XferCompLabelForm("accounting_error")
            lbl.set_value_center(six.text_type(lerr))
            lbl.set_location(0, row + 1, 4)
            xfer.add_component(lbl)
            btn = XferCompButton("accounting_conf")
            btn.set_action(xfer.request, Configuration.get_action(_("conf."), ""), close=CLOSE_NO)
            btn.set_location(0, row + 2, 4)
            xfer.add_component(btn)
        lab = XferCompLabelForm('accountingend')
        lab.set_value_center('{[hr/]}')
        lab.set_location(0, row + 3, 4)
        xfer.add_component(lab)
        return True
    else:
        return False
开发者ID:Diacamma2,项目名称:financial,代码行数:35,代码来源:views.py

示例13: fillresponse

# 需要导入模块: from lucterios.framework.xfercomponents import XferCompLabelForm [as 别名]
# 或者: from lucterios.framework.xfercomponents.XferCompLabelForm import set_location [as 别名]
 def fillresponse(self, costaccounting=0):
     if self.getparam("SAVE") 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_costaccounting')
         lbl.set_value_as_name(CostAccounting._meta.verbose_name)
         lbl.set_location(1, 1)
         dlg.add_component(lbl)
         sel = XferCompSelect('costaccounting')
         sel.set_select_query(CostAccounting.objects.filter(status=0))
         if self.item is not None:
             sel.set_value(self.item.costaccounting_id)
         sel.set_location(1, 2)
         dlg.add_component(sel)
         dlg.add_action(self.get_action(_('Ok'), 'images/ok.png'), params={"SAVE": "YES"})
         dlg.add_action(WrapAction(_('Cancel'), 'images/cancel.png'))
     else:
         if costaccounting == 0:
             new_cost = None
         else:
             new_cost = CostAccounting.objects.get(id=costaccounting)
         for item in self.items:
             if (item.costaccounting is None) or (item.costaccounting.status == 0):
                 item.costaccounting = new_cost
                 item.save()
开发者ID:Diacamma2,项目名称:financial,代码行数:30,代码来源:views_entries.py

示例14: fillresponse

# 需要导入模块: from lucterios.framework.xfercomponents import XferCompLabelForm [as 别名]
# 或者: from lucterios.framework.xfercomponents.XferCompLabelForm import set_location [as 别名]
 def fillresponse(self, limit_date=''):
     if limit_date == '':
         dlg = self.create_custom()
         img = XferCompImage('img')
         img.set_value(self.icon_path())
         img.set_location(0, 0, 1, 6)
         dlg.add_component(img)
         lbl = XferCompLabelForm('lb_limit_date')
         lbl.set_value_as_name(_('limit date'))
         lbl.set_location(1, 1, 1)
         dlg.add_component(lbl)
         limite_date = XferCompDate('limit_date')
         limite_date.set_needed(True)
         limite_date.set_value((date.today() - timedelta(weeks=25)))
         limite_date.set_location(1, 2, 1)
         dlg.add_component(limite_date)
         dlg.add_action(self.get_action(TITLE_OK, 'images/ok.png'), params={"SAVE": "YES"})
         dlg.add_action(WrapAction(TITLE_CANCEL, 'images/cancel.png'))
     else:
         third_ids = [val_third['third'] for val_third in EntryLineAccount.objects.filter(
             entry__date_value__gt=limit_date, third__gt=0).values('third')]
         for third in Third.objects.filter(status=0):
             if third.id not in third_ids:
                 third.status = 1
                 third.save()
开发者ID:Diacamma2,项目名称:financial,代码行数:27,代码来源:views.py

示例15: fillresponse

# 需要导入模块: from lucterios.framework.xfercomponents import XferCompLabelForm [as 别名]
# 或者: from lucterios.framework.xfercomponents.XferCompLabelForm import set_location [as 别名]
 def fillresponse(self):
     img_title = XferCompImage('img')
     img_title.set_location(0, 0, 1, 6)
     img_title.set_value(self.icon_path())
     self.add_component(img_title)
     lab = XferCompLabelForm('title')
     lab.set_location(1, 0, 2)
     lab.set_value_as_title(_("Print models"))
     self.add_component(lab)
     self.fill_from_model(1, 1, False, ['name'])
     self.fill_from_model(1, 2, True, ['kind'])
     self.item.mode = int(self.item.mode)
     if self.item.kind == 1:
         self.fill_from_model(1, 3, False, ['mode'])
         self.get_components('mode').set_action(
             self.request, self.get_action('', ''), {'modal': FORMTYPE_REFRESH, 'close': CLOSE_NO})
         if (self.item.mode == 1) and (self.item.value[:6] != '<model'):
             self.item.value = "<model>\n<body>\n<text>%s</text></body>\n</model>" % self.item.value
     if self.item.kind == 0:
         self._fill_listing_editor()
     elif (self.item.kind == 1) and (self.item.mode == 0):
         self._fill_label_editor()
     elif (self.item.kind == 2) or ((self.item.kind == 1) and (self.item.mode == 1)):
         self._fill_report_editor()
     self.add_action(
         PrintModelSave.get_action(_("ok"), "images/ok.png"), {})
     self.add_action(WrapAction(_('cancel'), 'images/cancel.png'), {})
开发者ID:povtux,项目名称:core,代码行数:29,代码来源:views.py


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