mirror of https://github.com/microsoft/autogen.git
fix model_config SQLModel (#3457)
* fix model_config SQLModel * added comment
This commit is contained in:
parent
4577524994
commit
ca1a89cb6b
|
@ -16,7 +16,19 @@ from sqlmodel import (
|
|||
Enum as SqlEnum,
|
||||
)
|
||||
|
||||
SQLModel.model_config["protected_namespaces"] = ()
|
||||
# added for python3.11 and sqlmodel 0.0.22 incompatibility
|
||||
if hasattr(SQLModel, "model_config"):
|
||||
SQLModel.model_config["protected_namespaces"] = ()
|
||||
elif hasattr(SQLModel, "Config"):
|
||||
|
||||
class CustomSQLModel(SQLModel):
|
||||
class Config:
|
||||
protected_namespaces = ()
|
||||
|
||||
SQLModel = CustomSQLModel
|
||||
else:
|
||||
print("Warning: Unable to set protected_namespaces.")
|
||||
|
||||
# pylint: disable=protected-access
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue