mirror of
https://github.com/fastapi-admin/fastapi-admin.git
synced 2025-08-26 20:20:21 +08:00
Merge pull request #43 from demyan1805/bugfix/nullable_fk_field
Not required for nullable foreign key field
This commit is contained in:
@ -304,7 +304,7 @@ class AdminApp(FastAPI):
|
|||||||
options = list(map(lambda x: {"text": str(x), "value": x.pk}, objs))
|
options = list(map(lambda x: {"text": str(x), "value": x.pk}, objs))
|
||||||
field = Field(
|
field = Field(
|
||||||
label=label,
|
label=label,
|
||||||
required=True,
|
required=not fk_field.get("nullable"),
|
||||||
type="select",
|
type="select",
|
||||||
options=options,
|
options=options,
|
||||||
sortable=name in sort_fields,
|
sortable=name in sort_fields,
|
||||||
|
Reference in New Issue
Block a user