Skip to content

Commit 1f76699

Browse files
authored
Merge pull request fastapi#20 from byrman/byrman_fix-issue-315
fix: SQLAlchemy version 1.4.36 breaks SQLModel relationships
2 parents 4d20051 + f0b0a40 commit 1f76699

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

sqlmodel/main.py

+1
Original file line numberDiff line numberDiff line change
@@ -369,6 +369,7 @@ def __init__(
369369
relationship_to, *rel_args, **rel_kwargs
370370
)
371371
dict_used[rel_name] = rel_value
372+
setattr(cls, rel_name, rel_value) # Fix #315
372373
DeclarativeMeta.__init__(cls, classname, bases, dict_used, **kw)
373374
else:
374375
ModelMetaclass.__init__(cls, classname, bases, dict_, **kw)

0 commit comments

Comments
 (0)