Skip to content

Commit 210451e

Browse files
authored
Fix field_name_id fields with postfix _id (#100)
1 parent 5f89403 commit 210451e

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

fastadmin/models/orms/tortoise.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ def get_model_fields_with_widget_types(
4343
if field_type in ("BackwardFKRelation", "BackwardOneToOneRelation"):
4444
continue
4545

46-
if field_name.endswith("_id") and hasattr(orm_model_field, "reference"):
46+
if field_name.endswith("_id") and getattr(orm_model_field, "reference", False):
4747
# ignore _id fields for relations
4848
continue
4949

0 commit comments

Comments
 (0)