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


Python XferCompLabelForm.set_value_as_infocenter方法代码示例

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


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

示例1: summary_dummy

# 需要导入模块: from lucterios.framework.xfercomponents import XferCompLabelForm [as 别名]
# 或者: from lucterios.framework.xfercomponents.XferCompLabelForm import set_value_as_infocenter [as 别名]
def summary_dummy(xfer):
    if not hasattr(xfer, 'add_component'):
        return True
    else:
        row = xfer.get_max_row() + 1
        lab = XferCompLabelForm('dummytitle')
        lab.set_value_as_infocenter("Dummy")
        lab.set_location(0, row, 4)
        xfer.add_component(lab)
        lbl = XferCompLabelForm('dummy_time')
        lbl.set_color('blue')
        lbl.set_location(0, row + 1, 4)
        lbl.set_centered()
        lbl.set_value(datetime.now().ctime())
        xfer.add_component(lbl)

        btn = XferCompButton('btnscheduler')
        btn.set_action(xfer.request, AddSchedulerTask.get_action('Task', ''))
        btn.set_location(0, row + 2, 4)
        xfer.add_component(btn)
        lbl = XferCompLabelForm('dummy-value')
        lbl.set_location(0, row + 3, 4)
        lbl.set_value(Params.getvalue('dummy-value'))
        xfer.add_component(lbl)
        return True
开发者ID:Lucterios2,项目名称:core,代码行数:27,代码来源:views.py

示例2: summary_documents

# 需要导入模块: from lucterios.framework.xfercomponents import XferCompLabelForm [as 别名]
# 或者: from lucterios.framework.xfercomponents.XferCompLabelForm import set_value_as_infocenter [as 别名]
def summary_documents(xfer):
    if not hasattr(xfer, 'add_component'):
        return WrapAction.is_permission(xfer, 'documents.change_document')
    elif WrapAction.is_permission(xfer.request, 'documents.change_document'):
        row = xfer.get_max_row() + 1
        lab = XferCompLabelForm('documenttitle')
        lab.set_value_as_infocenter(_('Document management'))
        lab.set_location(0, row, 4)
        xfer.add_component(lab)
        filter_result = Q()
        if notfree_mode_connect():
            filter_result = filter_result & (Q(folder=None) | Q(folder__viewer__in=xfer.request.user.groups.all() if xfer.request.user.id is not None else []))
        nb_doc = len(Document.objects.filter(*[filter_result]))
        lbl_doc = XferCompLabelForm('lbl_nbdocument')
        lbl_doc.set_location(0, row + 1, 4)
        if nb_doc == 0:
            lbl_doc.set_value_center(_("no file currently available"))
        elif nb_doc == 1:
            lbl_doc.set_value_center(_("one file currently available"))
        else:
            lbl_doc.set_value_center(_("%d files currently available") % nb_doc)
        xfer.add_component(lbl_doc)
        lab = XferCompLabelForm('documentend')
        lab.set_value_center('{[hr/]}')
        lab.set_location(0, row + 2, 4)
        xfer.add_component(lab)
        return True
    else:
        return False
开发者ID:Lucterios2,项目名称:documents,代码行数:31,代码来源:views.py

示例3: summary_accounting

# 需要导入模块: from lucterios.framework.xfercomponents import XferCompLabelForm [as 别名]
# 或者: from lucterios.framework.xfercomponents.XferCompLabelForm import set_value_as_infocenter [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

示例4: summary_contacts

# 需要导入模块: from lucterios.framework.xfercomponents import XferCompLabelForm [as 别名]
# 或者: from lucterios.framework.xfercomponents.XferCompLabelForm import set_value_as_infocenter [as 别名]
def summary_contacts(xfer):
    if not hasattr(xfer, 'add_component'):
        return WrapAction.is_permission(xfer, 'contacts.change_abstractcontact')
    else:
        if WrapAction.is_permission(xfer.request, 'contacts.change_abstractcontact'):
            row = xfer.get_max_row() + 1
            lab = XferCompLabelForm('contactstitle')
            lab.set_value_as_infocenter(_("Addresses and contacts"))
            lab.set_location(0, row, 4)
            xfer.add_component(lab)
            nb_legal_entities = len(LegalEntity.objects.all())
            lbl_doc = XferCompLabelForm('lbl_nblegalentities')
            lbl_doc.set_location(0, row + 1, 4)
            lbl_doc.set_value_center(_("Total number of legal entities: %d") % nb_legal_entities)
            xfer.add_component(lbl_doc)
            nb_individual = len(Individual.objects.all())
            lbl_doc = XferCompLabelForm('lbl_nbindividuals')
            lbl_doc.set_location(0, row + 2, 4)
            lbl_doc.set_value_center(_("Total number of individuals: %d") % nb_individual)
            xfer.add_component(lbl_doc)
            lab = XferCompLabelForm('contactsend')
            lab.set_value_center('{[hr/]}')
            lab.set_location(0, row + 3, 4)
            xfer.add_component(lab)
            return True
        else:
            return False
开发者ID:Lucterios2,项目名称:contacts,代码行数:29,代码来源:views_contacts.py

示例5: summary_dummy

# 需要导入模块: from lucterios.framework.xfercomponents import XferCompLabelForm [as 别名]
# 或者: from lucterios.framework.xfercomponents.XferCompLabelForm import set_value_as_infocenter [as 别名]
def summary_dummy(xfer):
    row = xfer.get_max_row() + 1
    lab = XferCompLabelForm('dummytitle')
    lab.set_value_as_infocenter("Dummy")
    lab.set_location(0, row, 4)
    xfer.add_component(lab)
    lbl = XferCompLabelForm('dummy_time')
    lbl.set_color('blue')
    lbl.set_location(0, row + 1, 4)
    lbl.set_centered()
    lbl.set_value(datetime.now().ctime())
    xfer.add_component(lbl)
    return True
开发者ID:povtux,项目名称:core,代码行数:15,代码来源:views.py

示例6: summary_condo

# 需要导入模块: from lucterios.framework.xfercomponents import XferCompLabelForm [as 别名]
# 或者: from lucterios.framework.xfercomponents.XferCompLabelForm import set_value_as_infocenter [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

示例7: fillresponse

# 需要导入模块: from lucterios.framework.xfercomponents import XferCompLabelForm [as 别名]
# 或者: from lucterios.framework.xfercomponents.XferCompLabelForm import set_value_as_infocenter [as 别名]
 def fillresponse(self, item_name=''):
     if item_name != '':
         self.item = Supporting.objects.get(id=self.getparam(item_name, 0))
     self.item = self.item.get_final_child()
     payments = PaymentMethod.objects.all()
     if not self.item.payoff_have_payment() or (len(payments) == 0):
         raise LucteriosException(MINOR, _('No payment for this document.'))
     max_row = self.get_max_row() + 1
     img = XferCompImage('img')
     img.set_value(self.icon_path())
     img.set_location(0, 0, 1, 6)
     self.add_component(img)
     self.fill_from_model(1, max_row, True, self.item.get_payment_fields())
     max_row = self.get_max_row() + 1
     lbl = XferCompLabelForm('lb_sep')
     lbl.set_value("{[hr/]}")
     lbl.set_location(1, max_row, 4)
     self.add_component(lbl)
     lbl = XferCompLabelForm('lb_title')
     lbl.set_value_as_infocenter(_("Payement methods"))
     lbl.set_location(1, max_row + 1, 4)
     self.add_component(lbl)
     for paymeth in payments:
         max_row = self.get_max_row() + 1
         lbl = XferCompLabelForm('lb_paymeth_%d' % paymeth.id)
         lbl.set_value_as_name(
             get_value_if_choices(paymeth.paytype, paymeth.get_field_by_name('paytype')))
         lbl.set_location(1, max_row)
         self.add_component(lbl)
         lbl = XferCompLabelForm('paymeth_%d' % paymeth.id)
         lbl.set_value(
             paymeth.show_pay(self.request.META.get('HTTP_REFERER', self.request.build_absolute_uri()), self.language, self.item))
         lbl.set_location(2, max_row, 3)
         self.add_component(lbl)
         lbl = XferCompLabelForm('sep_paymeth_%d' % paymeth.id)
         lbl.set_value("{[br/]}")
         lbl.set_location(2, max_row + 1)
         self.add_component(lbl)
     self.add_action(WrapAction(TITLE_CLOSE, 'images/close.png'))
开发者ID:Diacamma2,项目名称:financial,代码行数:41,代码来源:views.py

示例8: fill_dlg_payoff

# 需要导入模块: from lucterios.framework.xfercomponents import XferCompLabelForm [as 别名]
# 或者: from lucterios.framework.xfercomponents.XferCompLabelForm import set_value_as_infocenter [as 别名]
 def fill_dlg_payoff(self, withpayoff):
     dlg = self.create_custom(Payoff)
     dlg.caption = _("Valid bill")
     icon = XferCompImage('img')
     icon.set_location(0, 0, 1, 6)
     icon.set_value(self.icon_path())
     dlg.add_component(icon)
     lbl = XferCompLabelForm('lb_title')
     lbl.set_value_as_infocenter(_("Do you want validate '%s'?") % self.item)
     lbl.set_location(1, 1, 4)
     dlg.add_component(lbl)
     check_payoff = XferCompCheck('withpayoff')
     check_payoff.set_value(withpayoff)
     check_payoff.set_location(1, 2)
     check_payoff.java_script = """
 var type=current.getValue();
 parent.get('date_payoff').setEnabled(type);
 parent.get('amount').setEnabled(type);
 parent.get('payer').setEnabled(type);
 parent.get('mode').setEnabled(type);
 parent.get('reference').setEnabled(type);
 if (parent.get('bank_account')) {
     parent.get('bank_account').setEnabled(type);
 }
 """
     dlg.add_component(check_payoff)
     lbl = XferCompLabelForm('lb_withpayoff')
     lbl.set_value_as_name(_("Payment of deposit or cash"))
     lbl.set_location(2, 2)
     dlg.add_component(lbl)
     dlg.item.supporting = self.item
     dlg.fill_from_model(2, 3, False)
     if dlg.get_components("bank_fee") is not None:
         check_payoff.java_script += "parent.get('bank_fee').setEnabled(type);\n"
     dlg.get_components("date").name = "date_payoff"
     dlg.get_components("mode").set_action(self.request, self.get_action(), close=CLOSE_NO, modal=FORMTYPE_REFRESH)
     dlg.add_action(self.get_action(TITLE_OK, 'images/ok.png'), params={"CONFIRME": "YES"})
     dlg.add_action(WrapAction(TITLE_CANCEL, 'images/cancel.png'))
开发者ID:Diacamma2,项目名称:financial,代码行数:40,代码来源:views.py

示例9: summary_invoice

# 需要导入模块: from lucterios.framework.xfercomponents import XferCompLabelForm [as 别名]
# 或者: from lucterios.framework.xfercomponents.XferCompLabelForm import set_value_as_infocenter [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

示例10: fillresponse_show_criteria

# 需要导入模块: from lucterios.framework.xfercomponents import XferCompLabelForm [as 别名]
# 或者: from lucterios.framework.xfercomponents.XferCompLabelForm import set_value_as_infocenter [as 别名]
    def fillresponse_show_criteria(self):
        criteria_text_list = self.get_text_search()
        label = XferCompLabelForm('labelsearchDescTitle')
        if len(criteria_text_list) > 0:
            label.set_value_as_info("Your criteria of search")
            label.set_location(0, 17, 2, 4)
        else:
            label.set_value_as_infocenter("No criteria of search")
            label.set_location(0, 17, 4)
        self.add_component(label)

        row = 17
        for criteria_id, criteria_text in criteria_text_list.items():
            label = XferCompLabelForm('labelSearchText_' + criteria_id)
            label.set_value(criteria_text)
            label.set_location(2, row, 2)
            self.add_component(label)
            comp = XferCompButton("searchButtonDel_" + criteria_id)
            comp.set_is_mini(True)
            comp.set_location(4, row)
            comp.set_action(self.request, self.get_action("", "images/delete.png"), {
                            'modal': FORMTYPE_REFRESH, 'close': CLOSE_NO, 'params': {'ACT': criteria_id}})
            self.add_component(comp)
            row += 1
开发者ID:povtux,项目名称:core,代码行数:26,代码来源:xfersearch.py

示例11: _fill_listing_editor

# 需要导入模块: from lucterios.framework.xfercomponents import XferCompLabelForm [as 别名]
# 或者: from lucterios.framework.xfercomponents.XferCompLabelForm import set_value_as_infocenter [as 别名]
    def _fill_listing_editor(self):
        lab = XferCompLabelForm('lbl_page_width')
        lab.set_location(1, 3)
        lab.set_value_as_name(_("list page width"))
        self.add_component(lab)
        edt = XferCompFloat('page_width', 0, 9999, 0)
        edt.set_location(2, 3, 2)
        edt.set_value(self.item.page_width)
        self.add_component(edt)
        lab = XferCompLabelForm('lbl_page_height')
        lab.set_location(1, 4)
        lab.set_value_as_name(_("list page height"))
        self.add_component(lab)
        edt = XferCompFloat('page_heigth', 0, 9999, 0)
        edt.set_location(2, 4, 2)
        edt.set_value(self.item.page_height)
        self.add_component(edt)

        lab = XferCompLabelForm('lbl_col_size')
        lab.set_location(1, 5)
        lab.set_value_as_infocenter(_("size"))
        self.add_component(lab)
        lab = XferCompLabelForm('lbl_col_title')
        lab.set_location(2, 5)
        lab.set_value_as_infocenter(_("title"))
        self.add_component(lab)
        lab = XferCompLabelForm('lbl_col_text')
        lab.set_location(3, 5)
        lab.set_value_as_infocenter(_("text"))
        self.add_component(lab)

        col_index = 0
        for col_size, col_title, col_text in (self.item.columns + [[0, '', ''], [0, '', ''], [0, '', '']]):
            edt = XferCompFloat('col_size_%d' % col_index, 0, 999, 0)
            edt.set_location(1, 6 + col_index)
            edt.set_value(col_size)
            self.add_component(edt)
            edt = XferCompMemo('col_title_%d' % col_index)
            edt.set_location(2, 6 + col_index)
            edt.set_value(col_title)
            edt.set_size(75, 200)
            self.add_component(edt)
            edt = XferCompMemo('col_text_%d' % col_index)
            edt.set_location(3, 6 + col_index)
            edt.set_size(50, 300)
            edt.with_hypertext = True
            edt.set_value(col_text)
            self.fill_menu_memo(edt)
            self.add_component(edt)
            col_index += 1
开发者ID:povtux,项目名称:core,代码行数:52,代码来源:views.py

示例12: summary_member

# 需要导入模块: from lucterios.framework.xfercomponents import XferCompLabelForm [as 别名]
# 或者: from lucterios.framework.xfercomponents.XferCompLabelForm import set_value_as_infocenter [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

示例13: fillresponse

# 需要导入模块: from lucterios.framework.xfercomponents import XferCompLabelForm [as 别名]
# 或者: from lucterios.framework.xfercomponents.XferCompLabelForm import set_value_as_infocenter [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 = working_season.get_statistic()
        if len(stat_result) == 0:
            lab = XferCompLabelForm('lbl_season')
            lab.set_color('red')
            lab.set_value_as_infocenter(_('no subscription!'))
            lab.set_location(1, 1, 2)
            self.add_component(lab)
        else:
            tab_iden = 0
            for stat_title, stat_city, stat_type in stat_result:
                tab_iden += 1
                if (len(stat_city) > 0) and (len(stat_type) > 0):
                    self.new_tab(stat_title)
                    lab = XferCompLabelForm("lbltown_%d" % tab_iden)
                    lab.set_underlined()
                    lab.set_value(_("Result by city"))
                    lab.set_location(0, 1)
                    self.add_component(lab)
                    grid = XferCompGrid("town_%d" % tab_iden)
                    grid.add_header("city", _("city"))
                    grid.add_header("MajW", _("women major"))
                    grid.add_header("MajM", _("men major"))
                    grid.add_header("MinW", _("women minor"))
                    grid.add_header("MinM", _("men minor"))
                    grid.add_header("ratio", _("total (%)"))
                    cmp = 0
                    for stat_val in stat_city:
                        for stat_key in stat_val.keys():
                            grid.set_value(cmp, stat_key, stat_val[stat_key])
                        cmp += 1
                    grid.set_location(0, 2)
                    self.add_component(grid)

                    lab = XferCompLabelForm("lbltype_%d" % tab_iden)
                    lab.set_underlined()
                    lab.set_value(_("Result by type"))
                    lab.set_location(0, 3)
                    self.add_component(lab)
                    grid = XferCompGrid("type_%d" % tab_iden)
                    grid.add_header("type", _("type"))
                    grid.add_header("MajW", _("women major"))
                    grid.add_header("MajM", _("men major"))
                    grid.add_header("MinW", _("women minor"))
                    grid.add_header("MinM", _("men minor"))
                    grid.add_header("ratio", _("total (%)"))
                    cmp = 0
                    for stat_val in stat_type:
                        for stat_key in stat_val.keys():
                            if (stat_key == 'type') and not isinstance(stat_val['type'], six.text_type):
                                grid.set_value(cmp, stat_key, six.text_type(
                                    SubscriptionType.objects.get(id=stat_val['type'])))
                            else:
                                grid.set_value(
                                    cmp, stat_key, stat_val[stat_key])
                        cmp += 1
                    grid.set_location(0, 4)
                    self.add_component(grid)
        self.add_action(AdherentStatisticPrint.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,代码行数:82,代码来源:views.py


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