Skip to content

Commit

Permalink
fix relationships serialization
Browse files Browse the repository at this point in the history
  • Loading branch information
TheoLechemia committed May 7, 2021
1 parent 02a23a3 commit d219edd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/utils_flask_sqla/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ def serializefn(self, recursif=False, columns=(), exclude=[], relationships=(),
if getattr(self, rel):
# we call the child as_dict with a relationships list which exclude the current model
# this avoid infinite recursion when two models reference each other
_relationships = list(filter(lambda r: r[0] != rel, selected_relationships))
_relationships = list(filter(lambda r: r[0] != rel, relationships))
if uselist is True:
out[rel] = [
x.as_dict(recursif=recursif, depth=depth, relationships=_relationships)
Expand Down

0 comments on commit d219edd

Please sign in to comment.