-
-
Notifications
You must be signed in to change notification settings - Fork 41
Open
Labels
Description
When I'm filtering on an amount I want to include null values. This involves an or_.
I modified the filter method so it checks if there is a filter method defined, i.e:
class ProductFilter(Filter):
costs__lte: int | None = Field(None)
def filter_costs__lte(self, value: Any, query: Union[Query, Select]) -> Union[Query, Select]:
return query.filter(
or_(
Product.costs <= value,
Product.costs == null()
)
)
I can provide a PR when this is the way you want to go.
Thanks for providing this library!