Skip to content

Commit

Permalink
fix: 修复创建默认模型更新协议名称重复bug
Browse files Browse the repository at this point in the history
  • Loading branch information
amisadmin committed Feb 14, 2022
1 parent 09d4888 commit 6811c17
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion fastapi_amis_admin/crud/_sqlmodel.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,8 @@ def __init__(self, model: Type[SQLModel], session_factory: Callable[..., AsyncGe
exclude = set([self.parser.get_modelfield(ins).name for ins in
self.parser.filter_insfield(self.readonly_fields)])
exclude.add(self.pk_name)
self.schema_update = schema_create_by_schema(self.schema_model, 'Update', exclude=exclude, set_none=True)
self.schema_update = schema_create_by_schema(self.schema_model, self.__class__.__name__ + 'Update',
exclude=exclude, set_none=True)

async def on_create_pre(self, request: Request, obj: BaseModel, **kwargs) -> Dict[str, Any]:
data_dict = obj.dict() # exclude=set(self.pk)
Expand Down

0 comments on commit 6811c17

Please sign in to comment.