Reputation: 378
I have the following model:
class foo(models.Model):
range = DateTimeRangeField()
I want to find all rows where range is unbounded above. I tried the following query:
foo.objects.filter(range__endswith = None)
but it's giving my this exception: ValueError: Cannot use None as a query value. How can I do this?
Upvotes: 3
Views: 606
Reputation: 378
I found a solution:
foo.objects.filter(range__endswith__isnull = True)
Upvotes: 2