mirror of
https://github.com/fastapi-admin/fastapi-admin.git
synced 2026-03-13 10:32:25 +08:00
add step in Field with DecimalField and FloatField
This commit is contained in:
9
examples/Dockerfile
Normal file
9
examples/Dockerfile
Normal file
@@ -0,0 +1,9 @@
|
||||
FROM python:3
|
||||
RUN mkdir -p /src
|
||||
WORKDIR /src
|
||||
COPY ../pyproject.toml ../poetry.lock /src/
|
||||
RUN pip3 install poetry
|
||||
ENV POETRY_VIRTUALENVS_CREATE false
|
||||
RUN poetry install --no-root
|
||||
COPY . /src
|
||||
|
||||
0
examples/docker-compose.yml
Normal file
0
examples/docker-compose.yml
Normal 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:
|
||||
|
||||
@@ -68,7 +68,7 @@ class Field(BaseModel):
|
||||
ref: Optional[str]
|
||||
description: Optional[str]
|
||||
disabled: Optional[bool] = False
|
||||
step: str = 'any'
|
||||
step: str = "any"
|
||||
|
||||
|
||||
class Resource(BaseModel):
|
||||
|
||||
Reference in New Issue
Block a user