def boundfield_label_tag(field, contents):
    """
    A bound filed has a 'label_tag' method that optionally takes a
    'content' argument. If the content was not supplied it uses the
    field's label.

    There are times when we want to supply the content for the label
    instead of haivng it automatically field in from the field's label
    text.

    However, passing in arguments in the template system to methods is
    something we can not do. This tag lets us pass in a content
    argument to a BoundField instance's 'label_tag()' method.

    XXX Simple tags are annoying in that they do NOT support filters
        being applied to variables passed as arguments. When I have
        more time I will re-write this to be a proper tag so that we
        can pass variables in that have filters being applied to them,
        instead of using the {% with %} hack that we have to for now.

    Arguments:
    - `field`: The BoundField instance we are working with.
    - `contents`: The text to use for the <label></label>
    """
    if not hasattr(field, 'label_tag'):
        return ""
    return field.label_tag(contents = contents)