We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e5ad22d commit cf2897eCopy full SHA for cf2897e
fquery/sqlmodel.py
@@ -194,7 +194,9 @@ def decorator(cls):
194
if many_to_one:
195
type_class = cfield.type
196
other_class = type_class.__args__[0]
197
- other_class = getattr(other_class, "__name__", None)
+ if isinstance(other_class, ForwardRef):
198
+ other_class = other_class.__forward_arg__
199
+ other_class = getattr(other_class, "__name__", other_class)
200
key_table_name = default_table_name(other_class)
201
key_column_name = sql_meta.get(
202
"key_column_name", f"{key_table_name}.id"
0 commit comments