Skip to content

Commit

Permalink
Added one-to-many joins, as there might be no match either
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthias Erll committed Dec 13, 2022
1 parent 445360d commit 7d51d62
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions sqlalchemy_filters/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,12 @@ def should_filter_outer_join_relationship(operator):


def should_sort_outer_join_relationship(models):
return any(
column.nullable
for rel_model in models
for column in rel_model.prop.local_columns
)
for rel_model in models:
if rel_model.prop.direction == symbol('ONETOMANY'):
return True
elif any(column.nullable for column in rel_model.prop.local_columns):
return True
return False


def find_nested_relationship_model(mapper, field):
Expand Down

0 comments on commit 7d51d62

Please sign in to comment.