add step in Field with DecimalField and FloatField

This commit is contained in:
long2ice
2020-08-17 12:35:19 +08:00
parent 6cbdbcf574
commit 3cd3c10fd4
4 changed files with 12 additions and 1 deletions

View File

@@ -273,6 +273,8 @@ class AdminApp(FastAPI):
disabled=readonly,
description=data_field.get("description"),
)
if field_type == "DecimalField" or field_type == "FloatField":
field.step = "any"
field = field.copy(update=menu.attrs.get(name) or {})
fields[name] = field
if name in search_fields: