zmc
2023-08-08 e792e9a60d958b93aef96050644f369feb25d61b
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
U
¸ý°dã@spdZddlmZddlmZddlmZddlmZdd„Z    d    d
„Z
d d „Z d d„Z dd„Z dd„Zdd„ZdS)zgprivate module containing functions used for copying data
between instances based on join conditions.
 
é)Ú annotationsé)Úexc)Úutil)Ú PassiveFlagc Cs|j}|j}|D]ò\}    }
z(|j|    } |j| jj ||tj¡} Wn6tj    k
rv} zt
d||    ||
| ƒW5d} ~ XYnXz(|j|
} |j| jj  ||| d¡Wn6tj    k
rÖ} zt
d||    ||
| ƒW5d} ~ XYnX|r|    j r|
j r|
  |    ¡rd|jd||
f<qdS)NFTZ pk_cascaded)ÚdictÚ_columntopropertyÚmanagerÚkeyÚimplÚgetrÚ PASSIVE_OFFrÚUnmappedColumnErrorÚ_raise_col_to_propÚsetÚ primary_keyZ
referencesÚ
attributes)ÚsourceÚ source_mapperÚdestÚ dest_mapperÚsynchronize_pairsÚ    uowcommitZflag_cascaded_pksÚ source_dictZ    dest_dictÚlÚrÚpropÚvalueÚerr©rúJd:\z\workplace\vscode\pyvenv\venv\Lib\site-packages\sqlalchemy/orm/sync.pyÚpopulates4     
ÿ$
$ÿþýür!c Cs²|D]¨\}}z|j|}||j}Wn6tjk
rZ}ztd|||||ƒW5d}~XYnXz|j|}|||j<Wqtjk
rª}ztd|||||ƒW5d}~XYqXqdS)NFT)rr
rrr)rrrrrrrrrrr Úbulk_populate_inherit_keysAs 
$
r"c Cs’|D]ˆ\}}|jr>| ||j|¡tjkr>td|t |¡fƒ‚z| ||j|d¡Wqtj    k
rŠ}zt
dd||||ƒW5d}~XYqXqdS)NzKDependency rule tried to blank-out primary key column '%s' on instance '%s'T) rÚ_get_state_attr_by_columnrÚorm_utilZ    _none_setÚAssertionErrorZ    state_strZ_set_state_attr_by_columnrrr)rrrrrrrrr ÚclearQs  ÿÿþ ÿÿr&c
CsŒ|D]‚\}}z*| | ¡|¡}|j||j|tjd}Wn6tjk
rl}    ztd||d||    ƒW5d}    ~    XYnX|||j    <||||j    <qdS©N)ZpassiveF)
Z_get_committed_attr_by_columnÚobjr#rrr rrrr
)
rrrZ
old_prefixrrrZoldvaluerrrrr Úupdatecs  ÿÿ
$
r)c Csn|D]d\}}z|j||j|tjd}Wn6tjk
r\}ztd||d||ƒW5d}~XYnX|||j<qdSr')r#rrr rrrr
)rrZdict_rrrrrrrr Ú populate_dictrs ÿ
$r*c     Csz|D]p\}}z|j|}Wn6tjk
rP}ztd||d||ƒW5d}~XYnX| ||jtj¡}t|j    ƒrdSqdS)zpreturn true if the source object has changes from an old to a
    new value on the given synchronize pairs
 
    FNT)
rrrrZget_attribute_historyr
rZPASSIVE_NO_INITIALIZEÚboolZdeleted)    rrrrrrrrÚhistoryrrr Úsource_modified~s $ÿ
r-cCs4|rt d||f¡|‚nt d|||f¡|‚dS)NzÑCan't execute sync rule for destination column '%s'; mapper '%s' does not map this column.  Try using an explicit `foreign_keys` collection which does not include this column (or use a viewonly=True relation).zØCan't execute sync rule for source column '%s'; mapper '%s' does not map this column.  Try using an explicit `foreign_keys` collection which does not include destination column '%s' (or use a viewonly=True relation).)rr)ZisdestrZ source_columnrZ dest_columnrrrr r‘süÿúûÿùrN)Ú__doc__Ú
__future__rÚrrr$Úbaserr!r"r&r)r*r-rrrrr Ú<module>
s    +