Skip to content

Commit

Permalink
Support filtering on properties of related items.
Browse files Browse the repository at this point in the history
  • Loading branch information
colinhiggs committed Nov 2, 2017
1 parent e8c27d5 commit bd32a2c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pyramid_jsonapi/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1878,8 +1878,9 @@ def query_add_filtering(self, query):
)
)
if isinstance(prop.property, RelationshipProperty):
# TODO(Colin): deal with relationships properly.
pass
# The property indicated is on the other side of a relationship
query = query.join(prop)
prop = getattr(prop.property.mapper.class_, colspec[1])
try:
filtr = self.api.filter_registry.get_filter(type(prop.type), operator)
except KeyError:
Expand Down

0 comments on commit bd32a2c

Please sign in to comment.