From 0b6559ebff34987cb8d57df52f3f2dceb781816e Mon Sep 17 00:00:00 2001 From: laggron42 Date: Wed, 26 Jul 2023 17:05:50 +0200 Subject: [PATCH] Fix ForeignKey select menu --- fastapi_admin/resources.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/fastapi_admin/resources.py b/fastapi_admin/resources.py index c4e2a3b..dcfe349 100644 --- a/fastapi_admin/resources.py +++ b/fastapi_admin/resources.py @@ -171,8 +171,7 @@ class Model(Resource): name = input_.context.get("name") if isinstance(input_, inputs.ForeignKey): v = data.getlist(name)[0] - model = await input_.model.get(id=v) - ret[name] = model + ret[name] = int(v) if v else None continue if isinstance(input_, inputs.ManyToMany): v = data.getlist(name)