Skip to content

Commit

Permalink
fix issue with python 3.9
Browse files Browse the repository at this point in the history
  • Loading branch information
bouttier committed Sep 28, 2021
1 parent fa7e870 commit 404dae9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/utils_flask_sqla/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,13 +142,13 @@ def get_columns_and_relationships(fields, exclude):
raise Exception(f"Relationship '{field}' does not exist on {cls}.")

_columns = { key: col
for key, col in ChainMap(mapper.column_attrs, hybrid_properties).items()
for key, col in ChainMap(dict(mapper.column_attrs), hybrid_properties).items()
if key in fields }
_relationships = { key: rel
for key, rel in mapper.relationships.items()
if key in firstlevel_fields }
if not _columns:
_columns = ChainMap(mapper.column_attrs, hybrid_properties)
_columns = ChainMap(dict(mapper.column_attrs), hybrid_properties)
if exclude:
_columns = { key: col
for key, col in _columns.items()
Expand Down

0 comments on commit 404dae9

Please sign in to comment.