[Django]-How to use IntegerRangeField in Django template

5👍

Try out {{ field.upper }} and {{ field.lower}}.

4👍

Use upper and lower to get range from object of NumericRange.

In [5]: from psycopg2.extras import NumericRange

In [6]: a = NumericRange(2, 8, '[)')

In [7]: a.lower
Out[7]: 2

In [8]: a.upper
Out[8]: 8

Leave a comment