Skip to content

Commit

Permalink
sqlmodel: avoid using __dict__
Browse files Browse the repository at this point in the history
  • Loading branch information
adsharma committed Jan 11, 2025
1 parent 5d72c36 commit ab5a43b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion fquery/sqlmodel.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ def model(table: bool = True, table_name: str = None, global_id: bool = False):
"""

def sqlmodel(self) -> SQLModel:
return self.__sqlmodel__(**self.__dict__)
attrs = {name: getattr(self, name) for name in self.__sqlmodel__.__fields__}
return self.__sqlmodel__(**attrs)

def decorator(cls):
# Check if the class is a dataclass
Expand Down

0 comments on commit ab5a43b

Please sign in to comment.