You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
93c37c9 assumes that a range should always be passed when querying a range field, but that's not the case, particularly when performing a contains query:
Model.objects.filter(period__contains=datetime.datetime(2024, 3, 1))
# TypeError(FiniteDateTimeRangeField may only accept FiniteDatetimeRange objects)
93c37c9 assumes that a range should always be passed when querying a range field, but that's not the case, particularly when performing a
contains
query:We're too aggressive with the type checking. Django fields are a lot less strict, allowing ranges, tuples, and scalar values: https://github.com/django/django/blob/944745afe2ec45aed30cef799c250107f1364ca7/django/contrib/postgres/fields/ranges.py#L89-L96
We should just follow along, but perhaps prevent the case of using tuples, because the bounds are not well defined in that case.
The text was updated successfully, but these errors were encountered: