intorduce relation flags on basefield and simplify imports

This commit is contained in:
collerek
2021-02-21 17:46:06 +01:00
parent c560245760
commit e697235172
27 changed files with 163 additions and 149 deletions

View File

@ -21,7 +21,7 @@ def is_field_an_forward_ref(field: Type["BaseField"]) -> bool:
:return: result of the check
:rtype: bool
"""
return issubclass(field, ormar.ForeignKeyField) and (
return field.is_relation and (
field.to.__class__ == ForwardRef or field.through.__class__ == ForwardRef
)