@register.inclusion_tag('bootstrap/progress_bar.html')
def bs_progress_bar(*args, **kwargs):

    bars = []
    contexts = kwargs.get(
        'contexts',
        ['', 'success', 'info', 'warning', 'danger']
    )

    for ndx, arg in enumerate(args):
        bars.append(
            dict(percent=arg,
                 context=kwargs.get('context', contexts[ndx % len(contexts)]))
        )

    return {
        'bars': bars,
        'text': kwargs.pop('text', False),
        'striped': kwargs.pop('striped', False),
        'animated': kwargs.pop('animated', False),
        'min_val': kwargs.pop('min_val', 0),
        'max_val': kwargs.pop('max_val', 100),
    }
Helper for the field binding.  This is inspired by the way `deepcopy`
dataset/ETHPy150Open openstack/horizon/horizon/templatetags/bootstrap.py/bs_progress_bar--crossover with--dataset/ETHPy150Open mitsuhiko/fungiform/fungiform/forms.py/_bind