This is in the context of a Python API. I have a column where the value can be either True, False or Null, lets call it is_impounded. The Null "value" is when it is unknown whether it is impounded or not.
I want to be able to pass a query parameter in a GET request which gets all rows where it is unknown whether the car is impounded. I cant pass GET /cars?is_impounded=None because that is the same as GET /cars which returns ALL rows. My other thought was to use the strings 'yes' 'no' 'unknown' as the column value and then query GET /cars?is_impounded=unknown. But that just seems a bit odd.
Has anyone had this issue before and how did you resolve it?
GETrequests to. You may be able to use/cars?is_impounded=or it may implement something else such as passing JSON/cars?filters={"is_impounded":null}or anything else.Qobject to perform the filtering something likeCars.objects.all(Q(is_impounded__isnull=True))