@register.filter
def depth_as_range(depth):
    # reduce depth by 1 as treebeard root depth is 1
    return range(depth - 1)
dataset/ETHPy150Open tangentlabs/django-fancypages/fancypages/templatetags/fp_block_tags.py/depth_as_range/original