Django RangeFields - a group of PostgreSQL specific fields Creating models with numeric range fields

Help us to keep this website almost Ad Free! It takes only 10 seconds of your time:
> Step 1: Go view our video on YouTube: EF Core Bulk Insert
> Step 2: And Like the video. BONUS: You can also share it!

Example

It's simpler and easier to input values as a Python tuple instead of a NumericRange.

Book.objects.create(name='Pro Git', ratings_range=(5, 5))

Alternative method with NumericRange:

Book.objects.create(name='Pro Git', ratings_range=NumericRange(5, 5))


Got any Django Question?