Ejemplo n.º 1
0
    def get_row(self, df_row):

        if 'fmt_tag' in df_row:
            if df_row['fmt_tag'] == 'header':
                return TextBand(df_row['label'],
                                css_class='normal').get_rows(self)
            else:
                values = [
                    utils.entry(df_row[col_label]['text'],
                                link=df_row[col_label]['link'])
                    for col_label in self.column_order
                ]
                fmt_tag = df_row['fmt_tag']
                _css_class = ROW_FORMATS[fmt_tag]['css_class']
                _indent = ROW_FORMATS[fmt_tag]['indent']
                _type = ROW_FORMATS[fmt_tag]['type']
                return BasicBand(df_row['label'],
                                 css_class=_css_class,
                                 values=values,
                                 indent=_indent,
                                 type=_type).get_rows(self)
        else:
            values = [
                utils.entry(df_row[col_label]['text'],
                            link=df_row[col_label]['link'])
                for col_label in self.column_order
            ]
            return BasicBand(df_row['label'], css_class=df_row['css_class'], values=values, \
                                indent=df_row['indent'], type=df_row['type']).get_rows(self)
Ejemplo n.º 2
0
 def get_row(self, df_row):
     
     if 'fmt_tag' in df_row:
         if df_row['fmt_tag'] == 'header':
             return TextBand(df_row['label'], css_class='normal').get_rows(self)
         else:
             values = [utils.entry(df_row[col_label]['text'] , link=df_row[col_label]['link']) for col_label in self.column_order]
             fmt_tag = df_row['fmt_tag']
             _css_class = ROW_FORMATS[fmt_tag]['css_class']
             _indent  = ROW_FORMATS[fmt_tag]['indent']
             _type  = ROW_FORMATS[fmt_tag]['type']
             return BasicBand(df_row['label'], css_class=_css_class, values=values, indent=_indent, type=_type).get_rows(self)
     else:
         values = [utils.entry(df_row[col_label]['text'] , link=df_row[col_label]['link']) for col_label in self.column_order]
         return BasicBand(df_row['label'], css_class=df_row['css_class'], values=values, \
                             indent=df_row['indent'], type=df_row['type']).get_rows(self)
Ejemplo n.º 3
0
    def get_row(self, df_row):
        used_cols = [x for x in self.column_order if self.columns[x] in df_row]

        if df_row['fmt_tag'] == 'header':
            return TextBand(df_row['label'], css_class='normal').get_rows(self)
        else:
            values = [utils.entry(df_row[self.columns[col_label]] , link='') for col_label in used_cols]
            fmt_tag = df_row['fmt_tag']
            _css_class = ROW_FORMATS[fmt_tag]['css_class']
            _indent  = ROW_FORMATS[fmt_tag]['indent']
            _type  = ROW_FORMATS[fmt_tag]['type']
            return BasicBand(df_row['label'], css_class=_css_class, values=values, indent=_indent, type=_type).get_rows(self)