| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 6fe256e commit 6216409
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -519,9 +519,8 @@ def __setattr__(self, name: str, value: Any) -> None: | |||
| 519 | 519 | return | |
| 520 | 520 | else: | |
| 521 | 521 | # Set in SQLAlchemy, before Pydantic to trigger events and updates | |
| 522 | - if getattr(self.__config__, "table", False): | ||
| 523 | - if is_instrumented(self, name): | ||
| 524 | - set_attribute(self, name, value) | ||
| 522 | + if getattr(self.__config__, "table", False) and is_instrumented(self, name): | ||
| 523 | + set_attribute(self, name, value) | ||
| 525 | 524 | # Set in Pydantic model to trigger possible validation changes, only for | |
| 526 | 525 | # non relationship values | |
| 527 | 526 | if name not in self.__sqlmodel_relationships__: | |
@@ -611,7 +610,7 @@ def _calculate_keys( | |||
| 611 | 610 | exclude_unset: bool, | |
| 612 | 611 | update: Optional[Dict[str, Any]] = None, | |
| 613 | 612 | ) -> Optional[AbstractSet[str]]: | |
| 614 | - if include is None and exclude is None and exclude_unset is False: | ||
| 613 | + if include is None and exclude is None and not exclude_unset: | ||
| 615 | 614 | # Original in Pydantic: | |
| 616 | 615 | # return None | |
| 617 | 616 | # Updated to not return SQLAlchemy attributes | |
@@ -629,7 +628,6 @@ def _calculate_keys( | |||
| 629 | 628 | # Do not include relationships as that would easily lead to infinite | |
| 630 | 629 | # recursion, or traversing the whole database | |
| 631 | 630 | keys = self.__fields__.keys() # | self.__sqlmodel_relationships__.keys() | |
| 632 | - | ||
| 633 | 631 | if include is not None: | |
| 634 | 632 | keys &= include.keys() | |
| 635 | 633 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments