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


Python XferCompLabelForm.set_italic方法代码示例

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


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

示例1: fillresponse_header

# 需要导入模块: from lucterios.framework.xfercomponents import XferCompLabelForm [as 别名]
# 或者: from lucterios.framework.xfercomponents.XferCompLabelForm import set_italic [as 别名]
 def fillresponse_header(self):
     self.filter = Q()
     if self.getparam('year') is not None:
         year = FiscalYear.get_current(self.getparam('year'))
         self.filter &= Q(year=year)
         row_id = self.get_max_row() + 1
         lbl = XferCompLabelForm('title_year')
         lbl.set_italic()
         lbl.set_value("{[b]}%s{[/b]} : %s" % (_('fiscal year'), year))
         lbl.set_location(1, row_id, 1)
         self.add_component(lbl)
     if self.getparam('cost_accounting') is not None:
         cost = CostAccounting.objects.get(id=self.getparam('cost_accounting', 0))
         self.filter &= Q(cost_accounting=cost)
         row_id = self.get_max_row() + 1
         lbl = XferCompLabelForm('title_cost')
         lbl.set_italic()
         lbl.set_value("{[b]}%s{[/b]} : %s" % (_('cost accounting'), cost))
         lbl.set_location(1, row_id, 1)
         self.add_component(lbl)
     Signal.call_signal('editbudget', self)
开发者ID:Diacamma2,项目名称:financial,代码行数:23,代码来源:views_budget.py

示例2: fillresponse

# 需要导入模块: from lucterios.framework.xfercomponents import XferCompLabelForm [as 别名]
# 或者: from lucterios.framework.xfercomponents.XferCompLabelForm import set_italic [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_italic方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。