Skip to content

Commit

Permalink
fix: model dict copy
Browse files Browse the repository at this point in the history
  • Loading branch information
sfrvn committed Oct 11, 2024
1 parent 6a9f92c commit 1d268db
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
.mypy_cache/
.venv/
.vscode/
dist/
fastapi_sqlalchemy_toolkit.egg-info/
.pypirc
site/
site/
3 changes: 2 additions & 1 deletion fastapi_sqlalchemy_toolkit/model_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,8 @@ def __init__(
self.defaults: dict[str, Any] = {}

attr: InstrumentedAttribute
for attr_name, attr in self.model.__dict__.items():
model_attrs = self.model.__dict__.copy()
for attr_name, attr in model_attrs.items():
# Перебираем только атрибуты модели
if not attr_name.startswith("_"):
# Обрабатываем связи
Expand Down

0 comments on commit 1d268db

Please sign in to comment.