Skip to content

Commit

Permalink
Try to fix mypy
Browse files Browse the repository at this point in the history
  • Loading branch information
adsharma committed Mar 1, 2025
1 parent fc210a3 commit d1ad4ce
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions sqlmodel/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -598,11 +598,11 @@ def sqlmodel_rebuild(cls) -> None:
reg._dispose_manager_and_mapper(m)
del reg._managers[m]

return cls.__do_init__(cls.name, cls.__bases__, cls.__dict__)
return cls.__do_init__(cls.__name__, cls.__bases__, cls.__dict__)

# Override SQLAlchemy, allow both SQLAlchemy and plain Pydantic models
def __do_init__(
cls, classname: str, bases: Tuple[type, ...], dict_: Dict[str, Any], **kw: Any
cls, classname: str, bases: Tuple[type, ...], dict_: Mapping[str, Any], **kw: Any
) -> None:
# Only one of the base classes (or the current one) should be a table model
# this allows FastAPI cloning a SQLModel for the response_model without
Expand Down

0 comments on commit d1ad4ce

Please sign in to comment.