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


Python XferCompLabelForm.set_value_as_header方法代码示例

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


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

示例1: show_contact_invoice

# 需要导入模块: from lucterios.framework.xfercomponents import XferCompLabelForm [as 别名]
# 或者: from lucterios.framework.xfercomponents.XferCompLabelForm import set_value_as_header [as 别名]
def show_contact_invoice(contact, xfer):
    if WrapAction.is_permission(xfer.request, 'invoice.change_bill'):
        third = Third.objects.filter(contact_id=contact.id)
        if len(third) == 1:
            third = third[0]
            xfer.new_tab(_("Financial"))
            nb_build = len(Bill.objects.filter(third=third, status=0))
            nb_valid = len(Bill.objects.filter(third=third, status=1))
            lab = XferCompLabelForm('invoiceinfo')
            lab.set_value_as_header(_("There are %(build)d bills in building and %(valid)d validated") % {'build': nb_build, 'valid': nb_valid})
            lab.set_location(0, 5, 2)
            xfer.add_component(lab)
开发者ID:Diacamma2,项目名称:financial,代码行数:14,代码来源:views.py

示例2: summary_condo

# 需要导入模块: from lucterios.framework.xfercomponents import XferCompLabelForm [as 别名]
# 或者: from lucterios.framework.xfercomponents.XferCompLabelForm import set_value_as_header [as 别名]
def summary_condo(xfer):
    is_right = WrapAction.is_permission(xfer.request, 'condominium.change_set')
    owners = get_owners(xfer.request)
    if is_right or (len(owners) == 1):
        row = xfer.get_max_row() + 1
        lab = XferCompLabelForm('condotitle')
        lab.set_value_as_infocenter(_('Condominium'))
        lab.set_location(0, row, 4)
        xfer.add_component(lab)
    if len(owners) == 1:
        lab = XferCompLabelForm('condoowner')
        lab.set_value(_('You are a owner'))
        lab.set_location(0, row + 1, 2)
        xfer.add_component(lab)
        grid = XferCompGrid("part")
        grid.set_model(owners[0].partition_set.filter(set__is_active=True), ["set", "value", (_("ratio"), 'ratio')])
        grid.set_location(0, row + 2, 4)
        grid.set_size(200, 500)
        xfer.add_component(grid)
    if is_right:
        row = xfer.get_max_row() + 1
        nb_set = len(Set.objects.filter(is_active=True))
        nb_owner = len(Owner.objects.all())
        lab = XferCompLabelForm('condoinfo')
        lab.set_value_as_header(_("There are %(set)d classes of loads for %(owner)d owners") % {'set': nb_set, 'owner': nb_owner})
        lab.set_location(0, row + 1, 4)
        xfer.add_component(lab)
        if Params.getvalue("condominium-old-accounting"):
            lab = XferCompLabelForm('condoconvinfo')
            lab.set_value_as_header(_("Your condominium account is not in respect of French law{[newline]}An conversion is necessary."))
            lab.set_color('red')
            lab.set_location(0, row + 2, 4)
            xfer.add_component(lab)
            btn = XferCompButton('condoconv')
            btn.set_location(0, row + 3, 4)
            btn.set_action(xfer.request, CondominiumConvert.get_action(_('Convertion ...'), ""), close=CLOSE_NO)
            xfer.add_component(btn)
    if is_right or (len(owners) == 1):
        row = xfer.get_max_row() + 1
        lab = XferCompLabelForm('condosep')
        lab.set_value_as_infocenter("{[hr/]}")
        lab.set_location(0, row, 4)
        xfer.add_component(lab)
        return True
    else:
        return False
开发者ID:Diacamma2,项目名称:syndic,代码行数:48,代码来源:views.py

示例3: fill_current_folder

# 需要导入模块: from lucterios.framework.xfercomponents import XferCompLabelForm [as 别名]
# 或者: from lucterios.framework.xfercomponents.XferCompLabelForm import set_value_as_header [as 别名]
 def fill_current_folder(self, new_col, new_row):
     lbl = XferCompLabelForm('lblcat')
     lbl.set_value_as_name(_("current folder:"))
     lbl.set_location(new_col, new_row)
     self.add_component(lbl)
     lbl = XferCompLabelForm('lbltitlecat')
     if self.current_folder > 0:
         folder_obj = Folder.objects.get(id=self.current_folder)
         lbl.set_value(folder_obj.get_title())
         folder_description = folder_obj.description
     else:
         folder_obj = None
         lbl.set_value('>')
         folder_description = ""
     lbl.set_location(new_col + 1, new_row)
     self.add_component(lbl)
     lbl = XferCompLabelForm('lbldesc')
     lbl.set_value_as_header(folder_description)
     lbl.set_location(new_col + 2, new_row, 2)
     self.add_component(lbl)
     return folder_obj
开发者ID:Lucterios2,项目名称:documents,代码行数:23,代码来源:views.py

示例4: show

# 需要导入模块: from lucterios.framework.xfercomponents import XferCompLabelForm [as 别名]
# 或者: from lucterios.framework.xfercomponents.XferCompLabelForm import set_value_as_header [as 别名]
 def show(self, xfer):
     self._add_cost_savebtn(xfer)
     last_row = xfer.get_max_row() + 10
     lbl = XferCompLabelForm('sep3')
     lbl.set_location(0, last_row + 1, 6)
     lbl.set_value_center("{[hr/]}")
     xfer.add_component(lbl)
     xfer.filltab_from_model(1, last_row + 2, True, ['entrylineaccount_set'])
     grid_lines = xfer.get_components('entrylineaccount')
     grid_lines.actions = []
     if self.item.has_third:
         sum_customer = get_amount_sum(self.item.entrylineaccount_set.filter(
             account__code__regex=current_system_account().get_third_mask()).aggregate(Sum('amount')))
         if ((sum_customer < 0) and not self.item.has_cash) or ((sum_customer > 0) and self.item.has_cash):
             lbl = XferCompLabelForm('asset_warning')
             lbl.set_location(0, last_row + 3, 6)
             lbl.set_value_as_header(_("entry of accounting for an asset"))
             xfer.add_component(lbl)
     if self.item.link is not None:
         linkentries = EntryAccount.objects.filter(link=self.item.link).exclude(id=self.item.id)
         if len(linkentries) == 0:
             self.item.unlink()
         else:
             lbl = XferCompLabelForm('sep4')
             lbl.set_location(0, last_row + 4, 6)
             lbl.set_value_center("{[hr/]}")
             xfer.add_component(lbl)
             lbl = XferCompLabelForm('entrylinklab')
             lbl.set_location(1, last_row + 5, 5)
             lbl.set_value_center(_("Linked entries"))
             xfer.add_component(lbl)
             link_grid_lines = XferCompGrid('entryaccount_link')
             link_grid_lines.set_model(linkentries, fieldnames=None, xfer_custom=xfer)
             link_grid_lines.set_location(1, last_row + 6, 5)
             link_grid_lines.add_action(xfer.request, ActionsManage.get_action_url(
                 'accounting.EntryAccount', 'OpenFromLine', xfer), unique=SELECT_SINGLE, close=CLOSE_YES, params={'field_id': 'entryaccount_link', 'journal': ''})
             xfer.add_component(link_grid_lines)
     if self.added:
         xfer.add_action(xfer.get_action(TITLE_MODIFY, "images/ok.png"), params={"SAVE": "YES"})
开发者ID:Diacamma2,项目名称:financial,代码行数:41,代码来源:editors.py

示例5: fillresponse

# 需要导入模块: from lucterios.framework.xfercomponents import XferCompLabelForm [as 别名]
# 或者: from lucterios.framework.xfercomponents.XferCompLabelForm import set_value_as_header [as 别名]
    def fillresponse(self):
        img = XferCompImage('img')
        img.set_value(self.icon_path())
        img.set_location(0, 0, 1, 3)
        self.add_component(img)
        lbl = XferCompLabelForm('lbl_title')
        lbl.set_location(1, 0, 2)
        lbl.set_value_as_header(
            _("To receive by email your login and a new password."))
        self.add_component(lbl)

        lbl = XferCompLabelForm('lbl_email')
        lbl.set_location(1, 1)
        lbl.set_value_as_name(_("email"))
        self.add_component(lbl)
        pwd = XferCompEdit('email')
        pwd.set_location(2, 1)
        self.add_component(pwd)

        self.add_action(
            AskPasswordAct.get_action(_('Ok'), 'images/ok.png'), {})
        self.add_action(WrapAction(_('Cancel'), 'images/cancel.png'), {})
开发者ID:povtux,项目名称:core,代码行数:24,代码来源:views.py

示例6: situation_contacts

# 需要导入模块: from lucterios.framework.xfercomponents import XferCompLabelForm [as 别名]
# 或者: from lucterios.framework.xfercomponents.XferCompLabelForm import set_value_as_header [as 别名]
def situation_contacts(xfer):
    if not hasattr(xfer, 'add_component'):
        try:
            Individual.objects.get(user=xfer.user)
            return True
        except Exception:
            return False
    else:
        if not xfer.request.user.is_anonymous:
            try:
                current_individual = Individual.objects.get(user=xfer.request.user)
                row = xfer.get_max_row() + 1
                lab = XferCompLabelForm('contactsidentity')
                lab.set_value_as_header(six.text_type(current_individual))
                lab.set_location(0, row, 4)
                xfer.add_component(lab)
                lab = XferCompLabelForm('contactsend')
                lab.set_value_center('{[hr/]}')
                lab.set_location(0, row + 1, 4)
                xfer.add_component(lab)
                return True
            except Exception:
                return False
开发者ID:Lucterios2,项目名称:contacts,代码行数:25,代码来源:views_contacts.py

示例7: summary_invoice

# 需要导入模块: from lucterios.framework.xfercomponents import XferCompLabelForm [as 别名]
# 或者: from lucterios.framework.xfercomponents.XferCompLabelForm import set_value_as_header [as 别名]
def summary_invoice(xfer):
    is_right = WrapAction.is_permission(xfer.request, 'invoice.change_bill')
    contacts = []
    if not xfer.request.user.is_anonymous():
        for contact in Individual.objects.filter(user=xfer.request.user):
            contacts.append(contact.id)
        for contact in LegalEntity.objects.filter(responsability__individual__user=xfer.request.user):
            contacts.append(contact.id)
    if is_right or (len(contacts) > 0):
        row = xfer.get_max_row() + 1
        lab = XferCompLabelForm('invoicetitle')
        lab.set_value_as_infocenter(_("Invoice"))
        lab.set_location(0, row, 4)
        xfer.add_component(lab)
    if len(contacts) > 0:
        nb_build = len(Bill.objects.filter(third__contact_id__in=contacts))
        row = xfer.get_max_row() + 1
        lab = XferCompLabelForm('invoicecurrent')
        lab.set_value_as_header(_("You are %d bills") % nb_build)
        lab.set_location(0, row, 4)
        xfer.add_component(lab)
    if is_right:
        row = xfer.get_max_row() + 1
        nb_build = len(Bill.objects.filter(status=0))
        nb_valid = len(Bill.objects.filter(status=1))
        lab = XferCompLabelForm('invoiceinfo')
        lab.set_value_as_header(_("There are %(build)d bills in building and %(valid)d validated") % {'build': nb_build, 'valid': nb_valid})
        lab.set_location(0, row + 1, 4)
        xfer.add_component(lab)
    if is_right or (len(contacts) > 0):
        lab = XferCompLabelForm('invoicesep')
        lab.set_value_as_infocenter("{[hr/]}")
        lab.set_location(0, row + 2, 4)
        xfer.add_component(lab)
        return True
    else:
        return False
开发者ID:Diacamma2,项目名称:financial,代码行数:39,代码来源:views.py

示例8: summary_member

# 需要导入模块: from lucterios.framework.xfercomponents import XferCompLabelForm [as 别名]
# 或者: from lucterios.framework.xfercomponents.XferCompLabelForm import set_value_as_header [as 别名]
def summary_member(xfer):
    is_right = WrapAction.is_permission(xfer.request, 'member.change_adherent')
    try:
        current_adherent = Adherent.objects.get(user=xfer.request.user)
    except:
        current_adherent = None

    if is_right or (current_adherent is not None):
        row = xfer.get_max_row() + 1
        lab = XferCompLabelForm('membertitle')
        lab.set_value_as_infocenter(_("Adherents"))
        lab.set_location(0, row, 4)
        xfer.add_component(lab)
    if current_adherent is not None:
        ident = []
        if Params.getvalue("member-numero"):
            ident.append("%s %s" % (_('numeros'), current_adherent.num))
        if Params.getvalue("member-licence-enabled"):
            current_license = current_adherent.license
            if current_license is not None:
                ident.append(current_license)
        row = xfer.get_max_row() + 1
        lab = XferCompLabelForm('membercurrent')
        lab.set_value_as_header("{[br/]}".join(ident))
        lab.set_location(0, row, 4)
        xfer.add_component(lab)
    if is_right:
        row = xfer.get_max_row() + 1
        try:
            current_season = Season.current_season()
            dateref = current_season.date_ref
            lab = XferCompLabelForm('memberseason')
            lab.set_value_as_headername(six.text_type(current_season))
            lab.set_location(0, row + 1, 4)
            xfer.add_component(lab)
            nb_adh = len(Adherent.objects.filter(Q(subscription__begin_date__lte=dateref) & Q(
                subscription__end_date__gte=dateref) & Q(subscription__status=2)))
            lab = XferCompLabelForm('membernb')
            lab.set_value_as_header(_("Active adherents: %d") % nb_adh)
            lab.set_location(0, row + 2, 4)
            xfer.add_component(lab)
            nb_adhcreat = len(Adherent.objects.filter(
                Q(subscription__begin_date__lte=dateref) & Q(subscription__end_date__gte=dateref) & Q(subscription__status=1)))
            if nb_adhcreat > 0:
                lab = XferCompLabelForm('memberadhcreat')
                lab.set_value_as_header(_("No validated adherents: %d") % nb_adhcreat)
                lab.set_location(0, row + 3, 4)
                xfer.add_component(lab)
            nb_adhwait = len(Adherent.objects.filter(
                Q(subscription__begin_date__lte=dateref) & Q(subscription__end_date__gte=dateref) & Q(subscription__status=0)))
            if nb_adhwait > 0:
                lab = XferCompLabelForm('memberadhwait')
                lab.set_value_as_header(_("Adherents waiting moderation: %d") % nb_adhwait)
                lab.set_location(0, row + 4, 4)
                xfer.add_component(lab)
        except LucteriosException as lerr:
            lbl = XferCompLabelForm("member_error")
            lbl.set_value_center(six.text_type(lerr))
            lbl.set_location(0, row + 1, 4)
            xfer.add_component(lbl)
    if is_right or (current_adherent is not None):
        lab = XferCompLabelForm('member')
        lab.set_value_as_infocenter("{[hr/]}")
        lab.set_location(0, row + 5, 4)
        xfer.add_component(lab)
        return True
    else:
        return False
开发者ID:Diacamma2,项目名称:asso,代码行数:70,代码来源:views.py

示例9: selector_from_model

# 需要导入模块: from lucterios.framework.xfercomponents import XferCompLabelForm [as 别名]
# 或者: from lucterios.framework.xfercomponents.XferCompLabelForm import set_value_as_header [as 别名]
    def selector_from_model(self, col, row, field_name):

        dep_field = self.item._meta.get_field(
            field_name)
        if (not dep_field.auto_created or dep_field.concrete) and (dep_field.is_relation and dep_field.many_to_many):
            if hasattr(self.item, field_name + "__titles"):
                title_available, title_chosen = getattr(
                    self.item, field_name + "__titles")
            else:
                title_available, title_chosen = _("Available"), _("Chosen")
            availables = get_corrected_setquery(
                dep_field.remote_field.model.objects.all())
            java_script_init, java_script_treat = self._get_scripts_for_selectors(
                field_name, availables)

            lbl = XferCompLabelForm('hd_' + field_name + '_available')
            lbl.set_location(col + 1, row, 1, 1)
            lbl.set_value_as_header(title_available)
            self.add_component(lbl)

            lista = XferCompCheckList(field_name + '_available')
            lista.set_location(col + 1, row + 1, 1, 5)
            lista.set_size(200, 250)
            self.add_component(lista)

            lbl = XferCompLabelForm('hd_' + field_name + '_chosen')
            lbl.set_location(col + 3, row, 1, 1)
            lbl.set_value_as_header(title_chosen)
            self.add_component(lbl)

            listc = XferCompCheckList(field_name + '_chosen')
            listc.set_location(col + 3, row + 1, 1, 5)
            listc.set_size(200, 250)
            self.add_component(listc)

            btn_idx = 0
            for (button_name, button_title, button_script) in [("addall", ">>", """
if (%(comp)s_current !== null) {
    %(comp)s_valid ='';
    for (var key in %(comp)s_dico) {
        if (%(comp)s_valid !== '')
            %(comp)s_valid +=';';
        %(comp)s_valid +=key;
    }
    parent.mContext.put('%(comp)s',%(comp)s_valid);
}
"""), ("add", ">", """
if (%(comp)s_current !== null) {
    var value = parent.get('%(comp)s_available').getValue();
    if (%(comp)s_valid !== '')
        %(comp)s_valid +=';';
    %(comp)s_valid +=value;
parent.mContext.put('%(comp)s',%(comp)s_valid);
}
"""), ("del", "<", """
if (%(comp)s_current !== null) {
    var values = parent.get('%(comp)s_chosen').getValue().split(';');
    var valid_list = %(comp)s_valid.split(';');
    %(comp)s_valid ='';
    for (var key in valid_list) {
        selected_val = valid_list[key];
        if (values.indexOf(selected_val) === -1) {
            if (%(comp)s_valid !== '')
                %(comp)s_valid +=';';
            %(comp)s_valid +=selected_val;
        }
    }
    parent.mContext.put('%(comp)s',%(comp)s_valid);
}
"""), ("delall", "<<", """
if (%(comp)s_current !== null) {
    %(comp)s_valid ='';
    parent.mContext.put('%(comp)s',%(comp)s_valid);
}
""")]:
                btn = XferCompButton(field_name + '_' + button_name)
                btn.set_action(
                    self.request, WrapAction(button_title, ""), {'close': CLOSE_NO})
                btn.set_location(col + 2, row + 1 + btn_idx, 1, 1)
                btn.set_is_mini(True)
                btn.java_script = java_script_init + \
                    button_script % {'comp': field_name} + java_script_treat
                self.add_component(btn)
                btn_idx += 1
开发者ID:povtux,项目名称:core,代码行数:86,代码来源:xfergraphic.py

示例10: fillresponse

# 需要导入模块: from lucterios.framework.xfercomponents import XferCompLabelForm [as 别名]
# 或者: from lucterios.framework.xfercomponents.XferCompLabelForm import set_value_as_header [as 别名]
 def fillresponse(self, season):
     if season is None:
         working_season = Season.current_season()
     else:
         working_season = Season.objects.get(id=season)
     img = XferCompImage('img')
     img.set_value(self.icon_path())
     img.set_location(0, 0)
     self.add_component(img)
     lab = XferCompLabelForm('lbl_season')
     lab.set_value_as_name(_('season'))
     lab.set_location(1, 0)
     self.add_component(lab)
     sel = XferCompSelect('season')
     sel.set_needed(True)
     sel.set_select_query(Season.objects.all())
     sel.set_value(working_season.id)
     sel.set_location(2, 0)
     sel.set_action(self.request, self.get_action('', ''), modal=FORMTYPE_REFRESH, close=CLOSE_NO)
     self.add_component(sel)
     stat_result = Degree.get_statistic(working_season)
     if len(stat_result) == 0:
         lab = XferCompLabelForm('lbl_season')
         lab.set_color('red')
         lab.set_value_as_infocenter(_('no degree!'))
         lab.set_location(1, 1, 2)
         self.add_component(lab)
     else:
         total = 0
         pos_y = 2
         for activity, sublist in stat_result:
             subtotal = 0
             if activity is not None:
                 lab = XferCompLabelForm("lblactivite_%d" % activity.id)
                 lab.set_italic()
                 lab.set_value(six.text_type(activity))
                 lab.set_location(0, pos_y, 3)
                 self.add_component(lab)
                 pos_y += 1
             for degree_name, val in sublist:
                 lab = XferCompLabelForm("title_%d" % pos_y)
                 lab.set_value(degree_name)
                 lab.set_location(1, pos_y)
                 self.add_component(lab)
                 lab = XferCompLabelForm("val_%d" % pos_y)
                 lab.set_value(six.text_type(val))
                 lab.set_location(2, pos_y)
                 self.add_component(lab)
                 subtotal += val
                 total += val
                 pos_y += 1
             if activity is not None:
                 lab = XferCompLabelForm("lblsubtotal_%d" % activity.id)
                 lab.set_value_as_header(_("Total"))
                 lab.set_location(1, pos_y)
                 self.add_component(lab)
                 lab = XferCompLabelForm("subtotal_%d" % activity.id)
                 lab.set_italic()
                 lab.set_value(six.text_type(subtotal))
                 lab.set_location(2, pos_y)
                 self.add_component(lab)
                 pos_y += 1
         lab = XferCompLabelForm("lbltotal")
         lab.set_value_as_headername(_("Total"))
         lab.set_location(1, pos_y)
         self.add_component(lab)
         lab = XferCompLabelForm("total")
         lab.set_value_as_name(six.text_type(total))
         lab.set_location(2, pos_y)
         self.add_component(lab)
     self.add_action(DegreeStatisticPrint.get_action(TITLE_PRINT, "images/print.png"),
                     close=CLOSE_NO, params={'classname': self.__class__.__name__})
     self.add_action(WrapAction(TITLE_CLOSE, 'images/close.png'))
开发者ID:Diacamma2,项目名称:asso,代码行数:75,代码来源:views.py


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