File tree Expand file tree Collapse file tree 2 files changed +20
-20
lines changed
advanced_alchemy/repository Expand file tree Collapse file tree 2 files changed +20
-20
lines changed Original file line number Diff line number Diff line change @@ -1510,17 +1510,17 @@ async def update(
1510
1510
1511
1511
# Handle relationships by merging objects into session first
1512
1512
for relationship in mapper .mapper .relationships :
1513
- if (new_value := getattr (data , relationship .key , MISSING )) is not MISSING :
1514
- # Skip relationships that cannot be handled by generic merge operations
1515
- if relationship .viewonly or relationship .lazy in { # pragma: no cover
1516
- "write_only" ,
1517
- "dynamic" ,
1518
- "raise" ,
1519
- "raise_on_sql" ,
1520
- }:
1521
- # Skip relationships with incompatible lazy loading strategies
1522
- continue
1513
+ # Skip relationships that cannot be handled by generic merge operations
1514
+ if relationship .viewonly or relationship .lazy in { # pragma: no cover
1515
+ "write_only" ,
1516
+ "dynamic" ,
1517
+ "raise" ,
1518
+ "raise_on_sql" ,
1519
+ }:
1520
+ # Skip relationships with incompatible lazy loading strategies
1521
+ continue
1523
1522
1523
+ if (new_value := getattr (data , relationship .key , MISSING )) is not MISSING :
1524
1524
if isinstance (new_value , list ):
1525
1525
merged_values = [ # pyright: ignore
1526
1526
await self .session .merge (item , load = False ) # pyright: ignore
Original file line number Diff line number Diff line change @@ -1511,17 +1511,17 @@ def update(
1511
1511
1512
1512
# Handle relationships by merging objects into session first
1513
1513
for relationship in mapper .mapper .relationships :
1514
- if (new_value := getattr (data , relationship .key , MISSING )) is not MISSING :
1515
- # Skip relationships that cannot be handled by generic merge operations
1516
- if relationship .viewonly or relationship .lazy in { # pragma: no cover
1517
- "write_only" ,
1518
- "dynamic" ,
1519
- "raise" ,
1520
- "raise_on_sql" ,
1521
- }:
1522
- # Skip relationships with incompatible lazy loading strategies
1523
- continue
1514
+ # Skip relationships that cannot be handled by generic merge operations
1515
+ if relationship .viewonly or relationship .lazy in { # pragma: no cover
1516
+ "write_only" ,
1517
+ "dynamic" ,
1518
+ "raise" ,
1519
+ "raise_on_sql" ,
1520
+ }:
1521
+ # Skip relationships with incompatible lazy loading strategies
1522
+ continue
1524
1523
1524
+ if (new_value := getattr (data , relationship .key , MISSING )) is not MISSING :
1525
1525
if isinstance (new_value , list ):
1526
1526
merged_values = [ # pyright: ignore
1527
1527
self .session .merge (item , load = False ) # pyright: ignore
You can’t perform that action at this time.
0 commit comments