— Range of bigint • numrange — Range of numeric • tsrange — Range of timestamp without time zone • tstzrange — Range of timestamp with time zone • daterange — Range of date
in events]) >> [u'Meetup 2'] events = Event.objects.filter( ages__overlap=NumericRange(18, 22)) print([e.name for e in events]) >> [u'Meetup', u'Meetup 2']
class Hotel(models.Model): title = models.CharField(max_length=200) class Room(models.Model): hotel = models.ForeignKey(Hotel) title = models.CharField(max_length=200) class Booking(models.Model): room = models.ForeignKey(Room) dates = fields.ranges.DateRangeField()