Merge pull request #43 from demyan1805/bugfix/nullable_fk_field

Not required for nullable foreign key field
This commit is contained in:
long2ice
2021-04-22 19:41:52 +08:00
committed by GitHub

View File

@ -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,