Skip to content

preparations for 0.15.11 #228

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 10, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions fastcrud/crud/fast_crud.py
Original file line number Diff line number Diff line change
Expand Up @@ -520,7 +520,6 @@ def _parse_filters(
model = model or self.model
filters = []

# Check for special _or key for multi-field OR filtering
if "_or" in kwargs:
filters.extend(self._handle_multi_field_or_filter(model, kwargs.pop("_or")))

Expand Down Expand Up @@ -638,14 +637,12 @@ def _handle_multi_field_or_filter(
or_conditions = []

for field_condition, condition_value in value.items():
# Handle simple equality conditions (no operator)
if "__" not in field_condition:
col = getattr(model, field_condition, None)
if col is not None:
or_conditions.append(col == condition_value)
continue

# Handle conditions with operators
field_name, operator = field_condition.rsplit("__", 1)
try:
model_column = self._get_column(model, field_name)
Expand All @@ -659,7 +656,7 @@ def _handle_multi_field_or_filter(
)
or_conditions.append(condition)
except ValueError:
# Skip invalid columns
# TODO: log warning
continue

return [or_(*or_conditions)] if or_conditions else []
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "fastcrud"
version = "0.15.10"
version = "0.15.11"
description = "FastCRUD is a Python package for FastAPI, offering robust async CRUD operations and flexible endpoint creation utilities."
authors = [{ name = "Igor Benav", email = "[email protected]" }]
requires-python = ">=3.9.2,<4"
Expand Down