Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion fastapi_amis_admin/crud/_sqlalchemy.py
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,11 @@ async def on_update_pre(
**kwargs,
) -> Dict[str, Any]:
data = obj.dict(exclude=self.update_exclude, exclude_unset=True, by_alias=True)
data = {key: val for key, val in data.items() if val is not None or field_allow_none(model_fields(self.model)[key])}
data = {
key: val
for key, val in data.items()
if val is not None or field_allow_none(self.parser.get_table_model_fields(self.model)[key])
}
return data

async def on_filter_pre(self, request: Request, obj: Optional[SchemaFilterT], **kwargs) -> Dict[str, Any]:
Expand Down