1

Let's say I have a model with the DateTimeRangeField, and I would like to filter by the lower bound greater than now(), regardless whatupper bound is:

BackupResource.objects.filter(datetime_range__lower__gt=timezone.now())

It errors out:

Unsupported lookup 'lower' for DateTimeRangeField or join on the field not permitted.
James Lin
  • 25,028
  • 36
  • 133
  • 233

1 Answers1

2

Try doing the following

BackupResource.objects.filter(datetime_range__startswith__gt=timezone.now())
NS0
  • 6,016
  • 1
  • 15
  • 14