Django Including numeric range fields in your model


There are three kinds of numeric RangeFields in Python. IntegerField, BigIntegerField, and FloatField. They convert to psycopg2 NumericRanges, but accept input as native Python tuples. The lower bound is included and the upper bound is excluded.

class Book(models.Model):
    name = CharField(max_length=200)
    ratings_range = IntegerRange()