def setup_sort_column(widget, column=0, attribute=None, model=None):
    """
    *model* is the :class:`TreeModelSort` to act on. Defaults to what is
    displayed. Pass this if you sort before filtering.

    *widget* is a clickable :class:`TreeViewColumn`.

    *column* is an integer addressing the column in *model* that holds your
    objects.

    *attribute* is a string naming an object attribute to display. Defaults
    to the name of *widget*.
    """
    if not attribute:
        attribute = widget.get_name()
        if attribute is None:
            raise TypeError("Column not named")
    widget.connect('clicked', _clicked, column, attribute, model)