mirror of
https://github.com/fastapi-admin/fastapi-admin.git
synced 2025-08-26 10:40:18 +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))
|
||||
field = Field(
|
||||
label=label,
|
||||
required=True,
|
||||
required=not fk_field.get("nullable"),
|
||||
type="select",
|
||||
options=options,
|
||||
sortable=name in sort_fields,
|
||||
|
Reference in New Issue
Block a user