(self)
return attrs
Proxy to `.Column.attrs` but injects some values of our own.

        A ``th``, ``td`` and ``tf`` are guaranteed to be defined (irrespective
        of what is actually defined in the column attrs. This makes writing
        templates easier. ``tf`` is not actually a HTML tag, but this key name
        will be used for attributes for column's footer, if the column has one.
Proxy to `.Column.attrs` but injects some values of our own.
Proxy to . Column . attrs but injects some values of our own .
def attrs(self):
        """
        Proxy to `.Column.attrs` but injects some values of our own.

        A ``th``, ``td`` and ``tf`` are guaranteed to be defined (irrespective
        of what is actually defined in the column attrs. This makes writing
        templates easier. ``tf`` is not actually a HTML tag, but this key name
        will be used for attributes for column's footer, if the column has one.
        """

        # prepare kwargs for computed_values()
        kwargs = {"table": self._table, "bound_column": self}
        # BoundRow.items() sets current_record and current_value when iterating over
        # the records in a table.
        if (
            getattr(self, "current_record", None) is not None
            and getattr(self, "current_value", None) is not None
        ):
            kwargs.update({"record": self.current_record, "value": self.current_value})

        # Start with table's attrs; Only 'th' and 'td' attributes will be used
        attrs = dict(self._table.attrs)

        # Update attrs to prefer column's attrs rather than table's
        attrs.update(dict(self.column.attrs))

        # we take the value for 'cell' as the basis for both the th and td attrs
        cell_attrs = attrs.get("cell", {})

        # override with attrs defined specifically for th and td respectively.
        attrs["th"] = computed_values(attrs.get("th", cell_attrs), kwargs=kwargs)
        attrs["td"] = computed_values(attrs.get("td", cell_attrs), kwargs=kwargs)
        attrs["tf"] = computed_values(attrs.get("tf", cell_attrs), kwargs=kwargs)

        # wrap in AttributeDict
        attrs["th"] = AttributeDict(attrs["th"])
        attrs["td"] = AttributeDict(attrs["td"])
        attrs["tf"] = AttributeDict(attrs["tf"])

        # Override/add classes
        attrs["th"]["class"] = self.get_th_class(attrs["th"])
        attrs["td"]["class"] = self.get_td_class(attrs["td"])
        attrs["tf"]["class"] = self.get_td_class(attrs["tf"])

        return attrs
def attrs ( self ) : # prepare kwargs for computed_values() kwargs = { "table" : self . _table , "bound_column" : self } # BoundRow.items() sets current_record and current_value when iterating over # the records in a table. if ( getattr ( self , "current_record" , None ) is not None and getattr ( self , "current_value" , None ) is not None ) : kwargs . update ( { "record" : self . current_record , "value" : self . current_value } ) # Start with table's attrs; Only 'th' and 'td' attributes will be used attrs = dict ( self . _table . attrs ) # Update attrs to prefer column's attrs rather than table's attrs . update ( dict ( self . column . attrs ) ) # we take the value for 'cell' as the basis for both the th and td attrs cell_attrs = attrs . get ( "cell" , { } ) # override with attrs defined specifically for th and td respectively. attrs [ "th" ] = computed_values ( attrs . get ( "th" , cell_attrs ) , kwargs = kwargs ) attrs [ "td" ] = computed_values ( attrs . get ( "td" , cell_attrs ) , kwargs = kwargs ) attrs [ "tf" ] = computed_values ( attrs . get ( "tf" , cell_attrs ) , kwargs = kwargs ) # wrap in AttributeDict attrs [ "th" ] = AttributeDict ( attrs [ "th" ] ) attrs [ "td" ] = AttributeDict ( attrs [ "td" ] ) attrs [ "tf" ] = AttributeDict ( attrs [ "tf" ] ) # Override/add classes attrs [ "th" ] [ "class" ] = self . get_th_class ( attrs [ "th" ] ) attrs [ "td" ] [ "class" ] = self . get_td_class ( attrs [ "td" ] ) attrs [ "tf" ] [ "class" ] = self . get_td_class ( attrs [ "tf" ] ) return attrs