@register.filter<EOL>def get_range(value, max_num=None):
if max_num:<EOL><INDENT>value = max_num - value<EOL><DEDENT>return range(value)<EOL>
Returns the range over a given value.

Usage::

    {% load libs_tags %}

    {% for item in object_list.count|get_range %}
        {{ item }} // render real items here
    {% endfor %}
    {% for item in object_list.count|get_range:5 %}
        // render placeholder items here
    {% endfor %}

:param value: The number to pass to the range function
:param max_num: Optional. Use this if you want to get a range over the
  difference between the actual number and a maximum amount. This can
  be useful to display placeholder items in a situation where the
  space must always be filled up with 5 items but your actual list
  might only have 2 items.