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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
U
¸ý°dè¦ã@sUdZddlmZddlmZddlmZddlmZddl    Z    ddl
Z
ddl m Z ddl m Z dd    l mZdd
l mZdd l mZdd l mZdd l mZddl mZddl mZddl mZddl mZddl mZddl mZddl mZddl mZddl mZddl mZddl mZddl mZddl mZddl Z ddl!m"Z"ddl!m#Z$ddl!m%Z%ddl!m&Z&dd l!m'Z'dd!l!m(Z)dd"l*m+Z+dd#l,m-Z-dd$l,m.Z.dd%l,m/Z/dd&l,m0Z0dd'l,m1Z1dd(l2m3Z3dd)l2m4Z4dd*l2m5Z5dd+l2m6Z6dd,l2m7Z7dd-l2m8Z8dd.l2m9Z9dd/l:m;Z;d0d1l!m<Z<d0dl!m#Z=d0d2l!m>Z>d0d3l!m?Z?d0d4l!m@Z@d0d5l!mAZAd0d!l!m(Z(d0d6l<mBZBd0d7l<mCZCd0d8lAm,ZDd0d9lAmEZEd0d:lAmFZFd0d;lAmGZGd0d<lAmHZHd0d=lAmIZId0d!lAm(ZJd0d>lAmKZKd0d?lLmMZMd0d@lNmOZOd0dAlPmQZQd0dBlPmRZRd0dClSmTZTd0dDl(mUZUd0dEl(mVZVd0dFlWmXZXer€ddGl*mYZYddHl*mZZZddIl*m[Z[ddJl*m\Z\ddKl]m^Z^ddLl_m`Z`ddMlambZbddNlamcZcddOldmeZeddPl%mfZfddQl:mgZgddRl'mhZhddSlimjZjddTlkmlZlddUl(mmZmd0dVlnmoZod0dWlnmpZpd0dXlqmrZrd0dYlqmsZsd0dZltmuZud0d[lNmvZvd0d\lNmwZwd0d]lSmxZxd0d^l(myZyed_e d`Zzedadbd`Z{edcddd`Z|eeXdeeeeXdeeedfee ffedgfeedfee ffZ}e  ~¡Zdhe€di<djdkœdldm„Zdndkœdodp„Z‚dqaƒe( „dr¡Z…e
 †¡Z‡e>jˆe?j‰Gdsdt„dte8e7e+eMe5e?jŠe>j‹dueCee+ƒ
ƒƒZŒGdvdw„dweƒZŽdxdy„Zdzd{d|d}œd~d„Ze( ‘d€¡dzd{d|d}œdd‚„ƒZ’e( ‘d€¡dzd{d|d}œdƒd„„ƒZ“d…d†„Z”dqdqd‡œdˆd{d{d‰dŠœd‹dŒ„Z•ddŽ„Z–dd„Z—Gd‘d’„d’ed“ƒZ˜dS)”a5Logic to map Python classes to and from selectables.
 
Defines the :class:`~sqlalchemy.orm.mapper.Mapper` class, the central
configurational unit which associates a class with a database table.
 
This is a semi-private module; the main configurational API of the ORM is
available in :class:`~sqlalchemy.orm.`.
 
é)Ú annotations)Údeque)Úreduce)ÚchainN)ÚAny)ÚCallable)Úcast)Ú
Collection)ÚDeque)ÚDict)Ú    FrozenSet)ÚGeneric)ÚIterable)ÚIterator)ÚList)ÚMapping)ÚOptional)ÚSequence)ÚSet)ÚTuple)ÚType)Ú TYPE_CHECKING)ÚTypeVar)ÚUnioné)Ú
attributes)Úexc)Úinstrumentation)Úloading)Ú
properties)Úutil)Ú_O)Ú_class_to_mapper)Ú_parse_mapper_argument)Ú _state_mapper)Ú PassiveFlag)Ú    state_str)Ú_MappedAttribute)ÚEXT_SKIP)ÚInspectionAttr)ÚMapperProperty)ÚORMEntityColumnsClauseRole)ÚORMFromClauseRole)ÚStrategizedProperty)Ú PathRegistryé)Úevent)Ú
inspection)Úlog)Úschema)Úsql)Ú
dispatcher)Ú EventTarget)Úbase)Ú    coercions)Ú
expression)Ú    operators)Úroles)Ú TableClause)Úvisitors)ÚMemoizedHasCacheKey)ÚKeyedColumnElement)ÚColumn)ÚTable)ÚLABEL_STYLE_TABLENAME_PLUS_COL)Ú HasMemoized)Ú!HasMemoized_ro_memoized_attribute)ÚLiteral)Ú_IdentityKeyType)Ú _InstanceDict)Ú_ORMColumnExprArgument)Ú _RegistryType)Úregistry)ÚDependencyProcessor)ÚCompositeProperty)ÚSynonymProperty)Ú MapperEvents)Ú ClassManager)ÚCachingEntityRegistry)ÚColumnProperty)ÚRelationshipProperty)Ú InstanceState)Ú
ORMAdapter)ÚRow)Ú
RowMapping)Ú_ColumnExpressionArgument)Ú_EquivalentColumnMap)ÚReadOnlyColumnCollection)Ú ColumnClause)Ú ColumnElement)Ú
FromClause)Ú
OrderedSetÚ_T)ÚboundÚ_MPúMapperProperty[Any]Ú_FnzCallable[..., Any]Ú*ú Mapper[Any]r\z.weakref.WeakKeyDictionary[_RegistryType, bool]Ú_mapper_registriesz Set[registry]©Úreturnc
Cs$tttƒW5QR£SQRXdS©N)Ú_CONFIGURE_MUTEXÚsetre©rkrkúLd:\z\workplace\vscode\pyvenv\venv\Lib\site-packages\sqlalchemy/orm/mapper.pyÚ_all_registriesŒsrmúIterator[Mapper[Any]]ccstƒD]}| ¡EdHqdSrh)rmÚ_mappers_to_configure)ÚregrkrkrlÚ_unconfigured_mappers‘s
rqFÚ NO_ATTRIBUTEc @sÒ
eZdZUdZded<dZdZded<dZej    ddd¥d ddddddddddddddddddddddddddddd œd!d"„ƒZ
d#d$„Z d%d&„Z d
Z dZd'ed(<ed)d*œd+d,„ƒZed-d.„ƒZd ed/<d ed0<d1ed2<d3ed4<d5ed6<d7ed8<d9ed:<ded;<d<ed=<d>ed?<d@edA<dBedC<dDedE<dFedG<dHedI<dJedK<dLedM<dedN<dedO<dPedQ<dRedS<dedT<dUedV<dUedW<dXedY<dZed[<dZded\<ded]<d^ed_<d`eda<dedb<dedc<ddede<dfedg<dedh<diedj<dkedl<dkedm<eje dndo¡dpdq„ƒƒZejdrd*œdsdt„ƒZdudv„Zddwdxœdydz„Zd{d|„Zd}d~„Zdd€„Zdd‚„Zdwd*œdƒd„„Zd…d…d†d‡œdˆd‰„Zdwd*œdŠd‹„Z dwd*œdŒd„Z!d¦dŽd„Z"d    Z#e$j%dd‘„ƒZ&e$j%d’d“„ƒZ'e$j%d”d•„ƒZ(e )d–¡d—d˜„ƒZ*e )d–¡d
d
dd™œd…dšdddd›dœœddž„ƒZ+d…dŸd d¡œd¢d£„Z,d§d…d›dd¤ddd d¥œd¦d§„Z-e )d–¡d…d¨d d¡œd©dª„ƒZ.ej/ 0d«e1j2¡dwd*œd¬d­„ƒZ3dwd*œd®d¯„Z4d°d±„Z5d…d²dwd³œd´dµ„Z6dwd*œd¶d·„Z7ed…d*œd¸d¹„ƒZ8d…ddwdºœd»d¼„Z9d…ddwdºœd½d¾„Z:d…d*œd¿dÀ„Z;d…d*œdÁd„Z<dÃddĜdÅdƄZ=d…ddǜdÈdɄZ>d¨d…dd›dʜdËd̄Z?dÍdÎdϜdÐdфZ@edÒdӄƒZAdddÔd՜dÖdׄZBdØddUdٜdÚdۄZCe$j%dd*œdÜd݄ƒZDe$j%dÞd߄ƒZEe$j%dàdᄃZFe$j%dâd㄃ZGe$j%dÔd*œdäd儃ZHe$j%dæd焃ZIeJdUd*œdèd鄃ZKeHZLeJdêd넃ZMe$j%dìd턃ZNe$j%dîdZOe$j%dðdñ„ƒZPe$j%dòdó„ƒZQe$j%dôd*œdõdö„ƒZRe$j%dôd*œd÷dø„ƒZSe$j%dùd*œdúdû„ƒZTe$j%dùd*œdüdý„ƒZUe$j%dþd*œdÿd„ƒZVe$jWdd„ƒZXejdd„ƒZYedUd*œdd„ƒZZd©ddddd    œd
d „Z[e$j%d d „ƒZ\edd„ƒZ]dªdd„Z^e$j%dd*œdd„ƒZ_d«dd„Z`e$j%dd*œdd„ƒZae$j%dd*œdd„ƒZbe$j%e )d–¡dd*œdd „ƒƒZce$j%e )d–¡d!d*œd"d#„ƒƒZded$d%„ƒZee$j%d&d*œd'd(„ƒZfe$j%e )d)¡d*d*œd+d,„ƒƒZge$j%e )d–¡d-d*œd.d/„ƒƒZhd0d1d2œd3d4„Zie$j%d5d6„ƒZje$j%d7d*œd8d9„ƒZkd…ddd:œd;d<„Zle$j%d=d>„ƒZmd?d@„ZndiddAœdBdC„ZodiddAœdDdE„ZpdFdddGœdHdI„ZqdiddAœdJdK„ZrdLd*œdMdN„Zse$j%dÔd*œdOdP„ƒZtdLd*œdQdR„Zudid*œdSdT„Zvedid*œdUdV„ƒZwd¬dWdX„Zxd­dYddZd[d\œd]d^„Zyd®d_dd[d`œdadb„Zzdcd[ddœdedf„Z{e|j}fdÐdgd[dhœdidj„Z~dcd_ddœdkdl„Ze$j%dmdn„ƒZ€e$j%dodp„ƒZe$j%dqdr„ƒZ‚e$j%dsdt„ƒZƒe$j%dudv„ƒZ„e|j}fdÐdwdxdgddyœdzd{„Z…d|d}„Z†d~d„Z‡d€d„Zˆe|j}fd‚dƒ„Z‰d„d…„ZАd†d‡„Z‹e$j%dˆd‰„ƒZŒdАd‹„ZdŒd„ZŽe )dŽ¡dd„ƒZe$j%d‘d’„ƒZd¯d…dÐd“d”d•œd–d—„Z‘e$j%d˜d™„ƒZ’e$j%dšd›„ƒZ“e$j%dœd„ƒZ”ddždŸd œd¡d¢„Z•ejd£d¤„ƒZ–d    S(°ÚMapperašDefines an association between a Python class and a database table or
    other relational structure, so that ORM operations against the class may
    proceed.
 
    The :class:`_orm.Mapper` object is instantiated using mapping methods
    present on the :class:`_orm.registry` object.  For information
    about instantiating new :class:`_orm.Mapper` objects, see
    :ref:`orm_mapping_classes_toplevel`.
 
    zdispatcher[Mapper[_O]]ÚdispatchFrÚ_configure_failed)ú1.3aThe :paramref:`.mapper.non_primary` parameter is deprecated, and will be removed in a future release.  The functionality of non primary mappers is now better suited using the :class:`.AliasedClass` construct, which can also be used as the target of a :func:`_orm.relationship` in 1.3.)Ú non_primaryNTÚautoédzType[_O]zOptional[FromClause]z+Optional[Mapping[str, MapperProperty[Any]]]z/Optional[Iterable[_ORMColumnExprArgument[Any]]]Úboolz'Optional[Union[Mapper[Any], Type[Any]]]z)Optional[_ColumnExpressionArgument[bool]]z/Optional[Sequence[_ORMColumnExprArgument[Any]]]z%Optional[_ORMColumnExprArgument[Any]]z5Optional[Union[Literal[False], Callable[[Any], Any]]]zFOptional[Union[_ORMColumnExprArgument[Any], str, MapperProperty[Any]]]z Optional[Dict[Any, Mapper[Any]]]z Optional[Any]zOptional[_WithPolymorphicArg]z)Optional[Literal[('selectin', 'inline')]]z Optional[str]zOptional[Sequence[str]]zLiteral[(True, False, 'auto')]Úint)Úclass_Ú local_tablerÚ primary_keyrwÚinheritsÚinherit_conditionÚinherit_foreign_keysÚalways_refreshÚversion_id_colÚversion_id_generatorÚpolymorphic_onÚ_polymorphic_mapÚpolymorphic_identityÚconcreteÚwith_polymorphicÚpolymorphic_abstractÚpolymorphic_loadÚallow_partial_pksÚbatchÚ column_prefixÚinclude_propertiesÚexclude_propertiesÚpassive_updatesÚpassive_deletesÚconfirm_deleted_rowsÚeager_defaultsÚlegacy_is_orphanÚ_compiled_cache_sizec    CsØt |td¡|_d|jj|jjf|_t |¡|_||_    |    |_
t |
t ƒrV|
|_ d|_n |
dk    rptjtj|
ddnd|_| dkr†d|_n| dkršdd„|_n| |_||_d|_|dk    rÀt|ƒ|_nd|_|dk    ràt tj|¡|_n.|jrø|jj|_d    |_nt d
|jj›d ¡‚|dk    r*t tj|¡|_nd|_||_|rDt|ƒni|_ g|_!||_"||_#||_$| dk    r~tjtj| d dnd|_%||_&g|_'tj(|_)||_*||_+||_,d|_-d|_.d|_/i|_0||_1d|_2||_3|jrì|jsìd|_4n||_4| 5|¡||_6||_7| dkri|_8n| |_8|dk    r8t 9|¡|_:nd|_:|rRt 9|¡|_;nd|_;t<bt=d |j>j?ƒ @||¡| A¡| B¡| C¡| D¡| E¡|jF G|¡| Hd¡| I¡W5QRX|j> J||j¡dS)a¹VDirect constructor for a new :class:`_orm.Mapper` object.
 
        The :class:`_orm.Mapper` constructor is not called directly, and
        is normally invoked through the
        use of the :class:`_orm.registry` object through either the
        :ref:`Declarative <orm_declarative_mapping>` or
        :ref:`Imperative <orm_imperative_mapping>` mapping styles.
 
        .. versionchanged:: 2.0 The public facing ``mapper()`` function is
           removed; for a classical mapping configuration, use the
           :meth:`_orm.registry.map_imperatively` method.
 
        Parameters documented below may be passed to either the
        :meth:`_orm.registry.map_imperatively` method, or may be passed in the
        ``__mapper_args__`` declarative class attribute described at
        :ref:`orm_declarative_mapper_options`.
 
        :param class\_: The class to be mapped.  When using Declarative,
          this argument is automatically passed as the declared class
          itself.
 
        :param local_table: The :class:`_schema.Table` or other
           :class:`_sql.FromClause` (i.e. selectable) to which the class is
           mapped. May be ``None`` if this mapper inherits from another mapper
           using single-table inheritance. When using Declarative, this
           argument is automatically passed by the extension, based on what is
           configured via the :attr:`_orm.DeclarativeBase.__table__` attribute
           or via the :class:`_schema.Table` produced as a result of
           the :attr:`_orm.DeclarativeBase.__tablename__` attribute being
           present.
 
        :param polymorphic_abstract: Indicates this class will be mapped in a
            polymorphic hierarchy, but not directly instantiated. The class is
            mapped normally, except that it has no requirement for a
            :paramref:`_orm.Mapper.polymorphic_identity` within an inheritance
            hierarchy. The class however must be part of a polymorphic
            inheritance scheme which uses
            :paramref:`_orm.Mapper.polymorphic_on` at the base.
 
            .. versionadded:: 2.0
 
            .. seealso::
 
                :ref:`orm_inheritance_abstract_poly`
 
        :param always_refresh: If True, all query operations for this mapped
           class will overwrite all data within object instances that already
           exist within the session, erasing any in-memory changes with
           whatever information was loaded from the database. Usage of this
           flag is highly discouraged; as an alternative, see the method
           :meth:`_query.Query.populate_existing`.
 
        :param allow_partial_pks: Defaults to True.  Indicates that a
           composite primary key with some NULL values should be considered as
           possibly existing within the database. This affects whether a
           mapper will assign an incoming row to an existing identity, as well
           as if :meth:`.Session.merge` will check the database first for a
           particular primary key value. A "partial primary key" can occur if
           one has mapped to an OUTER JOIN, for example.
 
        :param batch: Defaults to ``True``, indicating that save operations
           of multiple entities can be batched together for efficiency.
           Setting to False indicates
           that an instance will be fully saved before saving the next
           instance.  This is used in the extremely rare case that a
           :class:`.MapperEvents` listener requires being called
           in between individual row persistence operations.
 
        :param column_prefix: A string which will be prepended
           to the mapped attribute name when :class:`_schema.Column`
           objects are automatically assigned as attributes to the
           mapped class.  Does not affect :class:`.Column` objects that
           are mapped explicitly in the :paramref:`.Mapper.properties`
           dictionary.
 
           This parameter is typically useful with imperative mappings
           that keep the :class:`.Table` object separate.  Below, assuming
           the ``user_table`` :class:`.Table` object has columns named
           ``user_id``, ``user_name``, and ``password``::
 
                class User(Base):
                    __table__ = user_table
                    __mapper_args__ = {'column_prefix':'_'}
 
           The above mapping will assign the ``user_id``, ``user_name``, and
           ``password`` columns to attributes named ``_user_id``,
           ``_user_name``, and ``_password`` on the mapped ``User`` class.
 
           The :paramref:`.Mapper.column_prefix` parameter is uncommon in
           modern use. For dealing with reflected tables, a more flexible
           approach to automating a naming scheme is to intercept the
           :class:`.Column` objects as they are reflected; see the section
           :ref:`mapper_automated_reflection_schemes` for notes on this usage
           pattern.
 
        :param concrete: If True, indicates this mapper should use concrete
           table inheritance with its parent mapper.
 
           See the section :ref:`concrete_inheritance` for an example.
 
        :param confirm_deleted_rows: defaults to True; when a DELETE occurs
          of one more rows based on specific primary keys, a warning is
          emitted when the number of rows matched does not equal the number
          of rows expected.  This parameter may be set to False to handle the
          case where database ON DELETE CASCADE rules may be deleting some of
          those rows automatically.  The warning may be changed to an
          exception in a future release.
 
        :param eager_defaults: if True, the ORM will immediately fetch the
          value of server-generated default values after an INSERT or UPDATE,
          rather than leaving them as expired to be fetched on next access.
          This can be used for event schemes where the server-generated values
          are needed immediately before the flush completes.
 
          The fetch of values occurs either by using ``RETURNING`` inline
          with the ``INSERT`` or ``UPDATE`` statement, or by adding an
          additional ``SELECT`` statement subsequent to the ``INSERT`` or
          ``UPDATE``, if the backend does not support ``RETURNING``.
 
          The use of ``RETURNING`` is extremely performant in particular for
          ``INSERT`` statements where SQLAlchemy can take advantage of
          :ref:`insertmanyvalues <engine_insertmanyvalues>`, whereas the use of
          an additional ``SELECT`` is relatively poor performing, adding
          additional SQL round trips which would be unnecessary if these new
          attributes are not to be accessed in any case.
 
          For this reason, :paramref:`.Mapper.eager_defaults` defaults to the
          string value ``"auto"``, which indicates that server defaults for
          INSERT should be fetched using ``RETURNING`` if the backing database
          supports it and if the dialect in use supports "insertmanyreturning"
          for an INSERT statement. If the backing database does not support
          ``RETURNING`` or "insertmanyreturning" is not available, server
          defaults will not be fetched.
 
          .. versionchanged:: 2.0.0rc1 added the "auto" option for
             :paramref:`.Mapper.eager_defaults`
 
          .. seealso::
 
                :ref:`orm_server_defaults`
 
          .. versionchanged:: 2.0.0  RETURNING now works with multiple rows
             INSERTed at once using the
             :ref:`insertmanyvalues <engine_insertmanyvalues>` feature, which
             among other things allows the :paramref:`.Mapper.eager_defaults`
             feature to be very performant on supporting backends.
 
        :param exclude_properties: A list or set of string column names to
          be excluded from mapping.
 
          .. seealso::
 
            :ref:`include_exclude_cols`
 
        :param include_properties: An inclusive list or set of string column
          names to map.
 
          .. seealso::
 
            :ref:`include_exclude_cols`
 
        :param inherits: A mapped class or the corresponding
          :class:`_orm.Mapper`
          of one indicating a superclass to which this :class:`_orm.Mapper`
          should *inherit* from.   The mapped class here must be a subclass
          of the other mapper's class.   When using Declarative, this argument
          is passed automatically as a result of the natural class
          hierarchy of the declared classes.
 
          .. seealso::
 
            :ref:`inheritance_toplevel`
 
        :param inherit_condition: For joined table inheritance, a SQL
           expression which will
           define how the two tables are joined; defaults to a natural join
           between the two tables.
 
        :param inherit_foreign_keys: When ``inherit_condition`` is used and
           the columns present are missing a :class:`_schema.ForeignKey`
           configuration, this parameter can be used to specify which columns
           are "foreign".  In most cases can be left as ``None``.
 
        :param legacy_is_orphan: Boolean, defaults to ``False``.
          When ``True``, specifies that "legacy" orphan consideration
          is to be applied to objects mapped by this mapper, which means
          that a pending (that is, not persistent) object is auto-expunged
          from an owning :class:`.Session` only when it is de-associated
          from *all* parents that specify a ``delete-orphan`` cascade towards
          this mapper.  The new default behavior is that the object is
          auto-expunged when it is de-associated with *any* of its parents
          that specify ``delete-orphan`` cascade.  This behavior is more
          consistent with that of a persistent object, and allows behavior to
          be consistent in more scenarios independently of whether or not an
          orphan object has been flushed yet or not.
 
          See the change note and example at :ref:`legacy_is_orphan_addition`
          for more detail on this change.
 
        :param non_primary: Specify that this :class:`_orm.Mapper`
          is in addition
          to the "primary" mapper, that is, the one used for persistence.
          The :class:`_orm.Mapper` created here may be used for ad-hoc
          mapping of the class to an alternate selectable, for loading
          only.
 
         .. seealso::
 
            :ref:`relationship_aliased_class` - the new pattern that removes
            the need for the :paramref:`_orm.Mapper.non_primary` flag.
 
        :param passive_deletes: Indicates DELETE behavior of foreign key
           columns when a joined-table inheritance entity is being deleted.
           Defaults to ``False`` for a base mapper; for an inheriting mapper,
           defaults to ``False`` unless the value is set to ``True``
           on the superclass mapper.
 
           When ``True``, it is assumed that ON DELETE CASCADE is configured
           on the foreign key relationships that link this mapper's table
           to its superclass table, so that when the unit of work attempts
           to delete the entity, it need only emit a DELETE statement for the
           superclass table, and not this table.
 
           When ``False``, a DELETE statement is emitted for this mapper's
           table individually.  If the primary key attributes local to this
           table are unloaded, then a SELECT must be emitted in order to
           validate these attributes; note that the primary key columns
           of a joined-table subclass are not part of the "primary key" of
           the object as a whole.
 
           Note that a value of ``True`` is **always** forced onto the
           subclass mappers; that is, it's not possible for a superclass
           to specify passive_deletes without this taking effect for
           all subclass mappers.
 
           .. seealso::
 
               :ref:`passive_deletes` - description of similar feature as
               used with :func:`_orm.relationship`
 
               :paramref:`.mapper.passive_updates` - supporting ON UPDATE
               CASCADE for joined-table inheritance mappers
 
        :param passive_updates: Indicates UPDATE behavior of foreign key
           columns when a primary key column changes on a joined-table
           inheritance mapping.   Defaults to ``True``.
 
           When True, it is assumed that ON UPDATE CASCADE is configured on
           the foreign key in the database, and that the database will handle
           propagation of an UPDATE from a source column to dependent columns
           on joined-table rows.
 
           When False, it is assumed that the database does not enforce
           referential integrity and will not be issuing its own CASCADE
           operation for an update.  The unit of work process will
           emit an UPDATE statement for the dependent columns during a
           primary key change.
 
           .. seealso::
 
               :ref:`passive_updates` - description of a similar feature as
               used with :func:`_orm.relationship`
 
               :paramref:`.mapper.passive_deletes` - supporting ON DELETE
               CASCADE for joined-table inheritance mappers
 
        :param polymorphic_load: Specifies "polymorphic loading" behavior
         for a subclass in an inheritance hierarchy (joined and single
         table inheritance only).   Valid values are:
 
          * "'inline'" - specifies this class should be part of
            the "with_polymorphic" mappers, e.g. its columns will be included
            in a SELECT query against the base.
 
          * "'selectin'" - specifies that when instances of this class
            are loaded, an additional SELECT will be emitted to retrieve
            the columns specific to this subclass.  The SELECT uses
            IN to fetch multiple subclasses at once.
 
         .. versionadded:: 1.2
 
         .. seealso::
 
            :ref:`with_polymorphic_mapper_config`
 
            :ref:`polymorphic_selectin`
 
        :param polymorphic_on: Specifies the column, attribute, or
          SQL expression used to determine the target class for an
          incoming row, when inheriting classes are present.
 
          May be specified as a string attribute name, or as a SQL
          expression such as a :class:`_schema.Column` or in a Declarative
          mapping a :func:`_orm.mapped_column` object.  It is typically
          expected that the SQL expression corresponds to a column in the
          base-most mapped :class:`.Table`::
 
            class Employee(Base):
                __tablename__ = 'employee'
 
                id: Mapped[int] = mapped_column(primary_key=True)
                discriminator: Mapped[str] = mapped_column(String(50))
 
                __mapper_args__ = {
                    "polymorphic_on":discriminator,
                    "polymorphic_identity":"employee"
                }
 
          It may also be specified
          as a SQL expression, as in this example where we
          use the :func:`.case` construct to provide a conditional
          approach::
 
            class Employee(Base):
                __tablename__ = 'employee'
 
                id: Mapped[int] = mapped_column(primary_key=True)
                discriminator: Mapped[str] = mapped_column(String(50))
 
                __mapper_args__ = {
                    "polymorphic_on":case(
                        (discriminator == "EN", "engineer"),
                        (discriminator == "MA", "manager"),
                        else_="employee"),
                    "polymorphic_identity":"employee"
                }
 
          It may also refer to any attribute using its string name,
          which is of particular use when using annotated column
          configurations::
 
                class Employee(Base):
                    __tablename__ = 'employee'
 
                    id: Mapped[int] = mapped_column(primary_key=True)
                    discriminator: Mapped[str]
 
                    __mapper_args__ = {
                        "polymorphic_on": "discriminator",
                        "polymorphic_identity": "employee"
                    }
 
          When setting ``polymorphic_on`` to reference an
          attribute or expression that's not present in the
          locally mapped :class:`_schema.Table`, yet the value
          of the discriminator should be persisted to the database,
          the value of the
          discriminator is not automatically set on new
          instances; this must be handled by the user,
          either through manual means or via event listeners.
          A typical approach to establishing such a listener
          looks like::
 
                from sqlalchemy import event
                from sqlalchemy.orm import object_mapper
 
                @event.listens_for(Employee, "init", propagate=True)
                def set_identity(instance, *arg, **kw):
                    mapper = object_mapper(instance)
                    instance.discriminator = mapper.polymorphic_identity
 
          Where above, we assign the value of ``polymorphic_identity``
          for the mapped class to the ``discriminator`` attribute,
          thus persisting the value to the ``discriminator`` column
          in the database.
 
          .. warning::
 
             Currently, **only one discriminator column may be set**, typically
             on the base-most class in the hierarchy. "Cascading" polymorphic
             columns are not yet supported.
 
          .. seealso::
 
            :ref:`inheritance_toplevel`
 
        :param polymorphic_identity: Specifies the value which
          identifies this particular class as returned by the column expression
          referred to by the :paramref:`_orm.Mapper.polymorphic_on` setting. As
          rows are received, the value corresponding to the
          :paramref:`_orm.Mapper.polymorphic_on` column expression is compared
          to this value, indicating which subclass should be used for the newly
          reconstructed object.
 
          .. seealso::
 
            :ref:`inheritance_toplevel`
 
        :param properties: A dictionary mapping the string names of object
           attributes to :class:`.MapperProperty` instances, which define the
           persistence behavior of that attribute.  Note that
           :class:`_schema.Column`
           objects present in
           the mapped :class:`_schema.Table` are automatically placed into
           ``ColumnProperty`` instances upon mapping, unless overridden.
           When using Declarative, this argument is passed automatically,
           based on all those :class:`.MapperProperty` instances declared
           in the declared class body.
 
           .. seealso::
 
               :ref:`orm_mapping_properties` - in the
               :ref:`orm_mapping_classes_toplevel`
 
        :param primary_key: A list of :class:`_schema.Column`
           objects, or alternatively string names of attribute names which
           refer to :class:`_schema.Column`, which define
           the primary key to be used against this mapper's selectable unit.
           This is normally simply the primary key of the ``local_table``, but
           can be overridden here.
 
           .. versionchanged:: 2.0.2 :paramref:`_orm.Mapper.primary_key`
              arguments may be indicated as string attribute names as well.
 
           .. seealso::
 
                :ref:`mapper_primary_key` - background and example use
 
        :param version_id_col: A :class:`_schema.Column`
           that will be used to keep a running version id of rows
           in the table.  This is used to detect concurrent updates or
           the presence of stale data in a flush.  The methodology is to
           detect if an UPDATE statement does not match the last known
           version id, a
           :class:`~sqlalchemy.orm.exc.StaleDataError` exception is
           thrown.
           By default, the column must be of :class:`.Integer` type,
           unless ``version_id_generator`` specifies an alternative version
           generator.
 
           .. seealso::
 
              :ref:`mapper_version_counter` - discussion of version counting
              and rationale.
 
        :param version_id_generator: Define how new version ids should
          be generated.  Defaults to ``None``, which indicates that
          a simple integer counting scheme be employed.  To provide a custom
          versioning scheme, provide a callable function of the form::
 
              def generate_version(version):
                  return next_version
 
          Alternatively, server-side versioning functions such as triggers,
          or programmatic versioning schemes outside of the version id
          generator may be used, by specifying the value ``False``.
          Please see :ref:`server_side_version_counter` for a discussion
          of important points when using this option.
 
          .. seealso::
 
             :ref:`custom_version_counter`
 
             :ref:`server_side_version_counter`
 
 
        :param with_polymorphic: A tuple in the form ``(<classes>,
            <selectable>)`` indicating the default style of "polymorphic"
            loading, that is, which tables are queried at once. <classes> is
            any single or list of mappers and/or classes indicating the
            inherited classes that should be loaded at once. The special value
            ``'*'`` may be used to indicate all descending classes should be
            loaded immediately. The second tuple argument <selectable>
            indicates a selectable that will be used to query for multiple
            classes.
 
            The :paramref:`_orm.Mapper.polymorphic_load` parameter may be
            preferable over the use of :paramref:`_orm.Mapper.with_polymorphic`
            in modern mappings to indicate a per-subclass technique of
            indicating polymorphic loading styles.
 
            .. seealso::
 
                :ref:`with_polymorphic_mapper_config`
 
        r|z%s.%sNrƒ©ÚargnameFcSs |pddS)Nrrrk)ÚxrkrkrlÚ<lambda>çóz!Mapper.__init__.<locals>.<lambda>TzMapper[zM(None)] has None for a primary table argument and does not specify 'inherits'r…rNZ constructed)Kr Zassert_arg_typeÚtyper|Ú
__module__Ú__name__Ú    _sort_keyÚto_listÚ_primary_key_argumentrwr‚Ú
isinstancer*Zversion_id_proprƒr8Úexpectr;ZColumnArgumentOrKeyRoler„rˆÚsingler#rÚStrictFromClauseRoler}Úsa_excÚ ArgumentErrorZ OnClauseRoler€rÚdictÚ_init_propertiesÚ_delete_orphansrr”rŽr…rŠÚ_dependency_processorsÚ
EMPTY_DICTÚ
validatorsr‘r’r•Z_clause_adapterÚ_requires_row_aliasingÚ_inherits_equated_pairsÚ_memoized_valuesr–Ú_reconstructorrŒr“Ú_set_with_polymorphicr‹r‡Úpolymorphic_mapÚto_setrrrirrtZ_eventsZ_new_mapper_instanceÚ_configure_inheritanceÚ _configure_class_instrumentationÚ_configure_propertiesÚ_configure_polymorphic_setterÚ_configure_pksrJZ_flag_new_mapperÚ_logÚ_expire_memoizationsZafter_mapper_constructed)Úselfr|r}rr~rwrr€rr‚rƒr„r…r†r‡rˆr‰rŠr‹rŒrrŽrrr‘r’r“r”r•r–rkrkrlÚ__init__¿sÔþ 
ûýù
  ÿ
ÿ
ÿ
ûýù    
 
 
ÿ 
zMapper.__init__cCs.|jdkr$|jsdS||jko"|jS|jSdS)NrxF)r”Zimplicit_returningÚ_server_default_col_keysZinsert_executemany_returning)r¼ÚdialectÚtablerkrkrlÚ_prefer_eager_defaultsZs
 
þzMapper._prefer_eager_defaultscCs|fSrhrk)r¼Zanon_mapZ
bindparamsrkrkrlÚ_gen_cache_keyfszMapper._gen_cache_keyrIrJú
Mapper[_O]rfcCs|S)z<Part of the inspection API.
 
        Returns self.
 
        rk©r¼rkrkrlÚmapperssz Mapper.mappercCs|jS)zDPart of the inspection API.
 
        Returns self.class\_.
 
        ©r|rÄrkrkrlÚentity|sz Mapper.entityr|Ú_identity_classzList[Tuple[str, Type[Any]]]rªzList[DependencyProcessor]r«zDict[Any, Callable[[], Any]]r°zutil.WeakSequence[Mapper[Any]]Ú_inheriting_mapperszSet[TableClause]Ú _all_tablesÚ_polymorphic_attr_keyz/Dict[FromClause, OrderedSet[ColumnClause[Any]]]Ú _pks_by_tablez0Dict[FromClause, OrderedSet[ColumnElement[Any]]]Ú_cols_by_tablez*util.OrderedDict[str, MapperProperty[Any]]Ú_propszDict[str, MapperProperty[Any]]r©Ú_ColumnMappingÚ_columntopropertyz-Optional[Callable[[InstanceState[_O]], None]]Ú_set_polymorphic_identityzHOptional[Callable[[Mapper[_O], InstanceState[_O], _InstanceDict], None]]Ú_validate_polymorphic_identityzSequence[TableClause]Útablesz3util.immutabledict[str, Tuple[str, Dict[str, Any]]]r­r‚rŒzOptional[ColumnElement[Any]]rƒzcOptional[Tuple[Union[Literal['*'], Sequence[Union[Mapper[Any], Type[Any]]]], Optional[FromClause]]]r‰r„r\r}Úpersist_selectablezOptional[Mapper[Any]]rzOptional[ColumnElement[bool]]r€Ú
configuredrˆzTuple[Column[Any], ...]r~zClassManager[_O]Ú class_managerr¤rwz!Optional[KeyedColumnElement[Any]]r…zDict[Any, Mapper[Any]]r³r‡rdÚ base_mapperz*ReadOnlyColumnCollection[str, Column[Any]]ÚcolumnsÚcrvzUse .persist_selectablecCs|jSrh)rÔrÄrkrkrlÚ mapped_table–szMapper.mapped_tablerPcCs
t |¡Srh)r.Z
per_mapperrÄrkrkrlÚ_path_registry›szMapper._path_registryc
Cs<t ¡|_|jrØt|j|jjƒs>t d|jj|jjjf¡‚|j     
|jj    ¡|j |jj kr„|j rhdpjd}t d||jj|f¡‚|j r˜|jj |_ n„|j|jjk    r|jrØ|j|_ | ¡D]}|jdk    r¾d|_q¾q|jdkrÈzt |jj|j¡|_WnÊtjk
rb}zD|jjdk    s$t‚|jdk    s4t‚t d|jjj|jjf¡|‚W5d}~XYnftjk
rÆ}zD|jjdk    sˆt‚|jdk    s˜t‚t d|jjj|jjf¡|‚W5d}~XYnX|jj dk    sÚt‚t |jj |j|j¡|_ t |j¡}tj|j j|d    |_ n|j|_ |j!dkrf|j|_"|j#s‚|jj$jdk    r‚t %|›d
|jj$j›d ¡n|jrx|j|_"n
|jj"|_"|j&dkr¤|jj&|_&|jj'|_'n:|jj&dk    rÞ|j&|jj&k    rÞt %d |j&j|jj&jf¡|jj(|_(|jj)|_)|jj *|¡|jj$|_$|jj+|_+|jj,p"|j,|_,|jj-|_-|j!dk    rx|j!|j(krlt %d |j!|j(|j!||j!f¡||j(|j!<|j.r’|jr’t d¡‚|j.dkr¬|j /|¡n*|j.dkrºn|j.dk    rt d|j.¡‚nFt0ƒ|_-||_$|jdk    söt‚|j|_ |j!dk    r||j(|j!<|j|_"|j dkr8t d|¡‚dS)zXConfigure settings related to inheriting and/or inherited mappers
        being present.z%Class '%s' does not inherit from '%s'Zprimaryz non-primaryzHInheritance of %s mapper for class '%s' is only allowed from a %s mapperNTa7Can't determine the inherit condition between inherited table '%s' and inheriting table '%s'; tables have no foreign key relationships established.  Please ensure the inheriting table has a foreign key relationship to the inherited table, or provide an 'on clause' using the 'inherit_condition' mapper argument.zìCan't determine the inherit condition between inherited table '%s' and inheriting table '%s'; tables have more than one foreign key relationship established.  Please specify the 'on clause' using the 'inherit_condition' mapper argument.)Zconsider_as_foreign_keysz| does not indicate a 'polymorphic_identity', yet is part of an inheritance hierarchy that has a 'polymorphic_on' column of 'a''. If this is an intermediary class that should not be instantiated, the class may either be left unmapped, or may include the 'polymorphic_abstract=True' parameter in its Mapper arguments. To leave the class unmapped when using Declarative, set the '__abstract__ = True' attribute on the class.zêInheriting version_id_col '%s' does not match inherited version_id_col '%s' and will not automatically populate the inherited versioning column. version_id_col should only be specified on the base-most mapper that includes versioning.zƒReassigning polymorphic association for identity %r from %r to %r: Check for duplicate use of %r as value for polymorphic_identity.zKpolymorphic_load is not currently supported with concrete table inheritanceÚinlineÚselectinz)unknown argument for polymorphic_load: %rz9Mapper '%s' does not have a persist_selectable specified.)1r Ú WeakSequencerÉrÚ
issubclassr|r¦r§ržrtÚ_updaterwr¤rÔr}rˆÚiterate_to_rootr…r®r€Úsql_utilZjoin_conditionZNoForeignKeysErrorÚAssertionErrorÚ descriptionZAmbiguousForeignKeysErrorr4Újoinr´rZcriterion_as_pairsZonclauser¯r‡rÈrŠr×Úwarnrƒr„r³rÚappendr‘r’rÊr‹Ú_add_with_polymorphic_subclassrj)r¼ÚnprÅZnfeZafeZfksrkrkrlrµŸs
ÿÿ þÿ 
  ÿ
 þõÿðþùÿ ô ý þ
 ÿ þÿ 
 
 
 
ÿ þþûÿ
 
 
 
ÿ
 
üýÿ ÿ   ÿÿ   ÿÿzMapper._configure_inheritanceÚNone)r‰rgcCs¶|dkrd|_n\t|ttfƒrLt|dtttfƒr@td|ƒ|_ql|df|_n |dk    rft d|›¡‚nd|_|jr¤|jddk    r¤|jdtj    t
j |jdddf|_|j r²|  ¡dS)    Nrc)rcNrz÷Tuple[
                        Union[
                            Literal["*"],
                            Sequence[Union["Mapper[Any]", Type[Any]]],
                        ],
                        Optional["FromClause"],
                    ]z&Invalid setting for with_polymorphic: rT©Z allow_select)r‰r¢ÚtupleÚlistÚstrrr¦r§r8r£r;r¥rÕr»)r¼r‰rkrkrlr²^s0ø ÿýþ    zMapper._set_with_polymorphiccCsd|j}|jdkr| |f¡nB|jddkr`t|jdtƒs@t‚| |jd|f|jdf¡dS)Nrrcr)r|r‰r²r¢rìrã)r¼rÅZsubclrkrkrlrè…s
ÿz%Mapper._add_with_polymorphic_subclasscCsä|js
t‚|jrt‚t|tƒs"t‚||_|jj |j¡|jj|_| ¡D]}|jdk    rJd|_    qJ|jj
|_
|j D]}|jj |_ qp|jj  |¡|jj|_|jj|_|j ¡D]2\}}||jkr¬|j||ddds¬| ||d¡q¬dS)z¹Set the given :class:`_orm.Mapper` as the 'inherits' for this
        :class:`_orm.Mapper`, assuming this :class:`_orm.Mapper` is concrete
        and does not already have an inherits.NTF©ÚlocalÚcolumn)rˆrãrr¢rsr³Úupdaterár…r®rÚself_and_descendantsr×rÉrçr‘rÊrÎÚitemsÚ_should_excludeÚ_adapt_inherited_property)r¼rÅÚmpÚkeyÚproprkrkrlÚ_set_concrete_bases.
 
 
 
 
 
 
 
ÿzMapper._set_concrete_basecCs||_| d¡dS)NT)r…r¸)r¼r…rkrkrlÚ_set_polymorphic_onªszMapper._set_polymorphic_oncCs¬t |j¡}|jrb|r|js,t d|j¡‚||_|jdk    s@t    ‚|j|_|j
j |_ |j  |¡dS|dksp|jszt d¡‚|j  ||j¡tj|j|t tj|¡dd}||_|jdk    s¼t    ‚|j|_|j
dkrÒdStj|dtddt |j¡D]¶\}}|dkr&t|d    ƒr&|j}t|d
ƒr&|j}t|ƒrðt|d ƒrT||_tj|d tddqðt|d ƒrð|j}|j D]:}||j!krŒt d||f¡‚|j! "|||fi¡|_!qjqðdS)a¤If this mapper is to be a primary mapper (i.e. the
        non_primary flag is not set), associate this Mapper with the
        given class and entity name.
 
        Subsequent calls to ``class_mapper()`` for the ``class_`` / ``entity``
        name combination will return this mapper.  Also decorate the
        `__init__` method on the mapped class to include optional
        auto-session attachment logic.
 
        ztClass %s has no primary mapper configured.  Configure a primary mapper first before setting up a non primary Mapper.NzÊThe _mapper() function and Mapper() constructor may not be invoked directly outside of a declarative registry. Please use the sqlalchemy.orm.registry.map_imperatively() function for a classical mapping.T)rÅZexpired_attribute_loaderÚfinalizeÚinit)Úrawr½Ú_sa_original_initÚ__func__Ú__sa_reconstructor__ÚloadÚ__sa_validators__zJA validation function for mapped attribute %r on mapper %s already exists.)#rZopt_manager_of_classr|rwZ    is_mappedr¦ÚInvalidRequestErrorrÖrJrãrÅrÈZ_add_non_primary_mapperrtÚinstrument_classrZregister_classr ÚpartialrZload_scalar_attributesr0ÚlistenÚ_event_on_initZiterate_attributesÚhasattrrÿrÚcallabler±Ú_event_on_loadÚ__sa_validation_opts__rr­Úunion)r¼ÚmanagerrøÚmethodZvalidation_optsÚnamerkrkrlr¶®sn 
þÿ
 ÿÿø 
 
 
 þÿ
ÿz'Mapper._configure_class_instrumentationcCs$d|_d|_d|_|j dd¡dS)NTru)rÕÚ_ready_for_configureÚ_dispose_calledÚ__dict__ÚpoprÄrkrkrlÚ_set_dispose_flags szMapper._set_dispose_flagsrîz Column[Any])r˜rørgc
Csºz|j|}Wn<tk
rJ}zt d|›d|›d¡|‚W5d}~XYnXz
|j}Wn<tk
r’}zt d|›d|›d¡|‚W5d}~XYnXt|tƒs¶t d|›d|›d¡‚|S)NzCan't determine z     column 'z(' - no attribute is mapped to this name.z4'; property does not refer to a single mapped Column)rÎÚKeyErrorr¦r§r9ÚAttributeErrorr¢r@)r¼r˜rørùÚerrÚexprZaerkrkrlÚ_str_arg_to_mapped_cols*ÿý
ÿý
ÿzMapper._str_arg_to_mapped_colcsFt ˆj¡ˆ_ˆj dd„ˆjDƒ¡iˆ_iˆ_t     t
dd„ˆj DƒŽ¡}t     dd„|Dƒ¡}t ˆjƒ  ˆjg¡D]F}|jr¢| |j¡r¢t |j¡ |¡ˆj|<t |j¡ |¡ˆj|<qtˆjrâ‡fdd„dd„ˆjDƒDƒ}nd}|r(|D]4}|jˆjkrt ¡ˆj|j<ˆj|j |¡qðnlˆjˆjksLtˆjˆjƒdkrdt d    ˆˆjjf¡‚n0ˆjˆjkr”tˆjtjƒr”t d
ˆjj¡ˆj r¸ˆj!s¸ˆjs¸ˆj jˆ_nt|rÜd d„‡fd d„|DƒDƒ}ntj"ˆjˆjd d}t|ƒdkrt d    ˆˆjjf¡‚t#|ƒˆ_ˆ $d|¡‡fdd„ˆj Dƒˆ_%dS)Ncss|]
}|VqdSrhrk)Ú.0ÚtrkrkrlÚ    <genexpr>,sz(Mapper._configure_pks.<locals>.<genexpr>cSsg|]
}|j‘qSrk©Ú    proxy_set©rÚcolrkrkrlÚ
<listcomp>2sz)Mapper._configure_pks.<locals>.<listcomp>css|]}|jr|VqdSrh©r~©rrÙrkrkrlr5scs&g|]}t|tƒrˆ d|¡n|‘qSr#)r¢rîrr$rÄrkrlr"Gsþÿcss |]}tjtj|ddVqdS)r~r—N)r8r£r;ZDDLConstraintColumnRole)rZ    coerce_pkrkrkrlrKs ûýrzJMapper %s could not assemble any primary key columns for mapped table '%s'zlCould not assemble any primary keys for locally mapped table '%s' - no rows will be persisted in this Table.cSs g|]\}}|dk    r|n|‘qSrhrk)rÚccrÙrkrkrlr"€sÿc3s|]}ˆj |¡|fVqdSrh)rÔÚcorresponding_columnr$rÄrkrlr‚sÿT)Zignore_nonexistent_tablesz"Identified primary key columns: %scs<h|]4}ˆj|ˆjkrt|dƒr.|jˆjkrˆj|’qS©rÀ)rÐÚ_identity_key_propsr    rÀrÍr rÄrkrlÚ    <setcomp>s
 
 ûz(Mapper._configure_pks.<locals>.<setcomp>)&râÚ find_tablesrÔrÓrÊròrÌrÍr Z
column_setrrÐrjr r~Ú
issupersetZordered_column_setÚ intersectionrÙr¡rÀr]ÚaddÚlenr¦r§rär}r¢r3rArærrˆZreduce_columnsrìrºÚ_readonly_props)r¼Zall_colsÚpk_colsZfcZcoerced_pk_argÚkr~rkrÄrlr¹)s˜ÿÿý
 ÿ 
úü
ÿþ
þÿÿýÿÿþý 
þþ 
þ
þÿ
 
þzMapper._configure_pkscCst ¡|_|_t ¡|_t|ƒ|_i}i}|j    r¸|j     
¡D]z\}}t |t ƒs\|  ||¡}n|}d}t |tjƒr¢|jD]*}|jj |¡rvd}|||<||f||<qv|r<|j||ddq<|jrH|jj 
¡D]z\}}|j||dddrèqÌ| |¡}    |    r.|j||d|    d}
|
||<|    jD]} ||
f|| <qqÌ||jkrÌ| ||d¡qÌ|jjD]²} | |kr€|| \}} |j|| ddqPn| |jkrqP|jpšd| j}|j| j||jj | ¡| drƐqP| ¡D]}| |jkrÎ|j| j}qÎ|j|| dddqPdS)NTF©rýrï)Ú    warn_onlyÚ incoming_propÚ©rýÚ    setparent)Úsql_baseZColumnCollectionrØrÙr Ú OrderedDictrÎrÏrÐr©rôr¢r*Ú_make_prop_from_columnrrQr}Zcontains_columnÚ_configure_propertyrrõÚgetÚ%_reconcile_prop_with_incoming_columnsrörÔrŽrørá)r¼Zexplicit_col_props_by_columnZexplicit_col_props_by_keyrøÚprop_argZpossible_col_propZ_map_as_property_nowZ    given_colZinherited_propr4Únew_propZinc_colrñrùZ
column_keyrÅrkrkrlr·§s
 
þ
ÿ 
þ
ÿ
ü
þ
 
   ü  ÿzMapper._configure_propertiesc
sŠd}d‰|jdk    r®d}t|jtƒrlz|j|j|_Wn4tk
rj}zt d|j¡|‚W5d}~XYnX|j|jkrˆ|j|j}nt|jtƒr´t|jt    j
ƒs¬t d¡‚|j}næ|j   |j¡}|dkr,d}d}|j}t|t jƒr0|jdks|jddks|jd  |¡dkr0t d|j¡‚nd}t|ddƒ}|rd| ||d|¡rzt d    |¡‚n| d
¡|_}|j}t    j
||d }|j|||dd |jd |_|j‰n|| ¡D]r}|jdk    r¶|j |j krÞ|j|_n|j   |j¡|_|jdk    r|j|_|j|_|j|_n d|_d|_dSq¶|jrH|jdkrHt d¡‚|rz‡fdd„}    ˆ|_‡fdd„}
|    |_|
|_n d|_d|_dS)a­Configure an attribute on the mapper representing the
        'polymorphic_on' column, if applicable, and not
        already generated by _configure_properties (which is typical).
 
        Also create a setter function which will assign this
        attribute to the value of the 'polymorphic_identity'
        upon instance construction, also if applicable.  This
        routine will run when an instance is created.
 
        FNTzPCan't determine polymorphic_on value '%s' - no attribute is mapped to this name.zUOnly direct column-mapped property or SQL expression can be passed for polymorphic_onrzkCould not map polymorphic_on column '%s' to the mapped table - polymorphic loads will not function properlyrøz6Cannot exclude or override the discriminator column %rZ_sa_polymorphic_on)Z _instrumentr6rz¡The Mapper.polymorphic_abstract parameter may only be used on a mapper hierarchy which includes the Mapper.polymorphic_on parameter at the base of the hierarchy.csR|j}|jjj}|dkr8|jjjr8t d|jj›d¡‚| ˆ¡ |||d¡dS)NzCan't instantiate class for z,; mapper is marked polymorphic_abstract=True)    r¨rrÅr‡rŠr¦rZget_implrj)ÚstateÚdict_r‡©Zpolymorphic_keyrkrlrѯs ÿÿþÿ
üzGMapper._configure_polymorphic_setter.<locals>._set_polymorphic_identitycs2ˆ|kr.|ˆ|jkr.t dt|ƒ|ˆf¡dS)NznFlushing object %s with incompatible polymorphic identity %r; the object may not refresh and/or load correctly)Ú"_acceptable_polymorphic_identitiesr Z warn_limitedr&)rÅr@rArBrkrlrÒÉsÿÿþüzLMapper._configure_polymorphic_setter.<locals>._validate_polymorphic_identity)r…r¢rîrÎrr¦r§rÐr*rrQrÔr&r3r@r‰rräÚgetattrrõÚlabelrør;rØrárÑrËrÒrŠ) r¼rýÚsetterrrùr!Z
instrumentrørÅrÑrÒrkrBrlr¸sº   þÿü  ÿÿÿ
ÿ þÿýýÿ ÿÿ   
ÿþ ÿÿÿ
ÿ  ÿz$Mapper._configure_polymorphic_settercCs|jdk    r|j|jSdSdSrh)rƒrÐrÄrkrkrlÚ_version_id_propàs
 zMapper._version_id_propcCsFtƒ}t|gƒ}|rB| ¡}|j|jkr| |j¡| |j¡q|Srh)rjrÚpopleftrÔr-r‡ÚextendrÉ)r¼Z
identitiesÚstackÚitemrkrkrlrCçs
  z)Mapper._acceptable_polymorphic_identitiescCst|j ¡ƒSrh)Ú    frozensetrÎÚvaluesrÄrkrkrlÚ    _prop_setôszMapper._prop_setzsqlalchemy.orm.descriptor_propscCsttjj}|js"|j||dddnN||jkrp|j ||¡}||ksZt|t    j
ƒrp|j |j krp|j||  ¡|dddS)NFr6T)r Ú    preloadedÚorm_descriptor_propsrˆr;rÎrÖÚ_get_class_attr_mror¢rZInstrumentedAttributeZ _parententityÚparentÚConcreteInheritedProperty)r¼rørùrýÚdescriptor_propsZimplementing_attributerkrkrlröøs,
ÿÿÿ
üüz Mapper._adapt_inherited_property)rýr7Úwarn_for_existingz3Union[KeyedColumnElement[Any], MapperProperty[Any]]ra)rør>rýr7rUrgcCs>tjj}| d||jj¡t|tƒs2| ||¡}n|}t|t    j
ƒrÈ|j   |j d¡}|dkrÊ|jrÊ|g}    |j ¡D]T}
|
j  |j d¡}|dk    r¾|    D]} | j  |¡q–|j   |j d¡}qÊ|     |
¡qt|dkr|j d}t|dƒrPt|dƒr|j|jkrP|j |¡n>t|dƒrP|j|jkrP||j|jkrP|j|j |¡t|dƒsz||jkpv|j d|jk|_t|tjƒr”||_|_|j  ||¡|j D]}|jD]} ||j| <q²q¨||_|rà|  ||¡||j!kr"t"|j!|ddƒr"|j!|j#} t$ %d    | ||| f¡‚||j!krˆt|t    j
ƒsˆt|j!|t    j
|j&fƒsˆt 'd
|j!|||f¡|j!|}|j( )|d¡|rÚ|j*j+ ,|d¡dk    rÚt|j! ,|d¡|j&fƒsÚt 'd |j*j+|||f¡||j!|<|j-sö| .|¡|j/D]}| 0|||¡qü|r*| 1¡| 2|¡|j3r:| 4¡|S) Nz_configure_property(%s, %s)rr/rÀrÍÚ_is_polymorphic_discriminatorÚ_mapped_by_synonymFzpCan't call map_column=True for synonym %r=%r, a ColumnProperty already exists keyed to the name %r for column %rzYProperty %s on %s being replaced with new property %s; the old property will be discardedziUser-placed attribute %r on %s being replaced with new property "%s"; the old attribute will be discarded)5r rOrPrºÚ    __class__ržr¢r*Ú_property_from_columnrrQrÔr&rØrrár}Ú_refresh_for_new_columnrçr    rÀrÍr/r-r…rVr9ZLabelrøZ _tq_key_labelrrÐZ
set_parentrÎrDrWr¦r§rSrærÛrr|rr<rwrrÉrörýÚpost_instrument_classrÕr»)r¼rør>rýr7rUrTrùr!ÚpathÚmÚm2Z    proxy_colÚsynZoldproprÅrkrkrlr;sØ
ÿ
ÿÿ 
 
 ÿ
þÿ
þý  þ 
 
 ÿ 
þÿÿ
þþþý þÿ
ÿþ þýþÿ
 
 
 
zMapper._configure_propertyzAUnion[Sequence[KeyedColumnElement[Any]], KeyedColumnElement[Any]]zColumnProperty[Any])rørñrgcCsˆt |¡}g}|D]j}|j |¡}|dkrr|j |¡}|dk    rJ|j |¡|j |¡}|dkrrt d|||f¡‚| |¡qt    j
|ŽS)Nz¼When configuring property '%s' on %s, column '%s' is not represented in the mapper's table. Use the `column_property()` function to force this column to be mapped as a read-only attribute.) r r rÔr&r}rZr¦r§rçrrQ)r¼rørñrØZ mapped_columnrÙZmcrkrkrlr:ªs"
    üÿ zMapper._make_prop_from_columnzOptional[ColumnProperty[Any]])røÚ existing_propr3r4Ú single_columnrgc Cs|r|jst|tjƒs|S|jd}|r6||jkr6|S|dkr^|dk    sJt‚|}|jd|f}n$|dksjt‚|jd}||jdf}|jr’||jkrÞ| |¡sÞ||jk    rÞ||jk    rÞd|jd||f}    |rÔt     
|    ¡n
t   |    ¡‚|  ¡}
|
j d|¡| d|¡|
S)Nrz•Implicitly combining column %s with column %s under attribute '%s'.  Please configure one or more attributes for these same-named columns explicitly.éÿÿÿÿzAinserting column to existing list in properties.ColumnProperty %s)rˆr¢rrQrØrãr¯Zshares_lineagerƒr rær¦rÚcopyÚinsertrº) r¼rør`r3r4raZexisting_columnZincoming_columnZequated_pair_keyÚmsgr?rkrkrlr=ÊsV    ÿ
þ
 
þýûúù
ýüÿ  
ýz,Mapper._reconcile_prop_with_incoming_columnszKeyedColumnElement[Any]cCsttjj}|j |¡}t|tjƒr8|j||||j    |k    dS|dksLt||j
ƒrX|  ||¡St   d|||j|f¡‚dS)zrgenerate/update a :class:`.ColumnProperty` given a
        :class:`_schema.Column` or other SQL expression object.)rar3NaWARNING: when configuring property '%s' on %s, column '%s' conflicts with property '%r'. To resolve this, map the column to the class under a different name in the 'properties' dictionary.  Or, to remove all awareness of the column entirely (including its availability as a foreign key), use the 'include_properties' or 'exclude_properties' mapper arguments to control specifically which table columns get mapped.)r rOrPrÎr<r¢rrQr=rRrSr:r¦r§rø)r¼rørñrTrùrkrkrlrY     s&      ü
ÿ  øÿzMapper._property_from_columnzŠThis warning originated from the `configure_mappers()` process, which was invoked automatically in response to a user-initiated operation.cCs|jjrt|jhdddS)NT©Úcascade)rJÚ _new_mappersÚ_configure_registriesrÄrkrkrlÚ_check_configure2    szMapper._check_configurecCst| d¡dd„|j ¡Dƒ}|D]<\}}| d|¡|j|krN|jsN| ¡|jr"| |¡q"| d¡d|_dS)zÝCall the ``init()`` method on all ``MapperProperties``
        attached to this mapper.
 
        This is a deferred configuration step which is intended
        to execute once all mappers have been constructed.
 
        z$_post_configure_properties() startedcSsg|]\}}||f‘qSrkrk)rrørùrkrkrlr"F    sz5Mapper._post_configure_properties.<locals>.<listcomp>zinitialize prop %sz%_post_configure_properties() completeTN)    rºrÎrôrRZ_configure_startedrýZ_configure_finishedr[rÕ)r¼ÚlrørùrkrkrlÚ_post_configure_properties<    s    
 
z!Mapper._post_configure_propertiescCs"| ¡D]\}}| ||¡qdS)z^Add the given dictionary of properties to this mapper,
        using `add_property`.
 
        N)rôÚ add_property)r¼Zdict_of_propertiesrøÚvaluerkrkrlÚadd_propertiesS    szMapper.add_propertiesz'Union[Column[Any], MapperProperty[Any]])rørùrgcCs.|j|||jd}t|tƒs t‚||j|<dS)aAAdd an individual MapperProperty to this mapper.
 
        If the mapper has not been configured yet, just adds the
        property to the initial properties dictionary sent to the
        constructor.  If this Mapper has already been configured, then
        the given MapperProperty is configured immediately.
 
        r2N)r;rÕr¢r*rãr©)r¼rørùrkrkrlrm[    s zMapper.add_propertycCs| ¡D] }| ¡qdSrh)ráZ_reset_memoizations©r¼rÅrkrkrlr»j    s zMapper._expire_memoizationscCs>d|jjd|jdk    r |jjp(t|jƒ|jr4dp6ddS)Nú(ú|z |non-primaryr5ú))r|ržr}rärîrwrÄrkrkrlÚ    _log_descn    sÿþ
ÿú ø    ÷ÿzMapper._log_desc)reÚargsrgcGs"|jjd|f|jf|žŽdS©Nz%s )ÚloggerÚinfort©r¼rerurkrkrlrº}    sz Mapper._logcGs"|jjd|f|jf|žŽdSrv)rwÚdebugrtryrkrkrlÚ
_log_debug€    szMapper._log_debugcCsdt|ƒ|jjfS)Nz<Mapper at 0x%x; %s>)Úidr|ržrÄrkrkrlÚ__repr__ƒ    szMapper.__repr__cCs2d|jj|jrdpd|jdk    r&|jjn|jjfS)NzMapper[%s%s(%s)]z (non-primary)r5)r|ržrwr}rärÔrÄrkrkrlÚ__str__†    s ÿ
ûzMapper.__str__zInstanceState[_O])r@rgcCstd}| ¡D]T}|jD]H\}}d}t |¡j|||jd}|jrL|rLdS|js|sdSqq |jrl|SdSdS)NFT)Z
optimistic)rárªrZmanager_of_classÚ
has_parentZ has_identityr•)r¼r@Zorphan_possiblerÅrøÚclsrrkrkrlÚ
_is_orphan    s  
ÿ
 
 zMapper._is_orphan)rørgcCs
||jkSrh)rΩr¼rørkrkrlÚ has_property£    szMapper.has_property)røÚ_configure_mappersrgc
CsZ|r | ¡z |j|WStk
rT}zt d|›d|›d¡|‚W5d}~XYnXdS)z6return a MapperProperty associated with the given key.zMapper 'z' has no property 'zw'.  If this property was indicated from other mappers or configure events, ensure registry.configure() has been called.N)rjrÎrr¦r)r¼rør„rrkrkrlÚ get_property¦    s ÿüzMapper.get_propertyzColumnElement[_T]zMapperProperty[_T])rñrgcCs
|j|S)zkGiven a :class:`_schema.Column` object, return the
        :class:`.MapperProperty` which maps this column.©rÐ)r¼rñrkrkrlÚget_property_by_column·    szMapper.get_property_by_columncCst|j ¡ƒS)z1return an iterator of all MapperProperty objects.)ÚiterrÎrMrÄrkrkrlÚiterate_properties¿    szMapper.iterate_propertieszSequence[Mapper[Any]])ÚspecÚ
selectablergcs¾|dkrt|jƒ}nz|rŠtƒ‰t |¡D]J}t|ƒ}| |¡sPt d||f¡‚|dkrhˆ     | 
¡¡q(ˆ  |¡q(‡fdd„|jDƒ}ng}|dk    rºtt j |ddƒ‰‡fdd„|Dƒ}|S)    z÷given a with_polymorphic() argument, return the set of mappers it
        represents.
 
        Trims the list of mappers to just those represented within the given
        selectable, if present. This helps some more legacy-ish mappings.
 
        rcz%r does not inherit from %rNcsg|]}|ˆkr|‘qSrkrk©rr])Ú
mapper_setrkrlr"Þ    sz-Mapper._mappers_from_spec.<locals>.<listcomp>T)Zinclude_aliasescsg|]}|jˆkr|‘qSrk)r}rŒ)rÓrkrlr"æ    s
)rírórjr r r"Úisar¦rròrár-râr*)r¼rŠr‹Úmappersr]rk)rrÓrlÚ_mappers_from_specÅ    s*
 
 
ÿ  ÿzMapper._mappers_from_speczIterable[Mapper[Any]])rÚ    innerjoinrgcCs\|j}|D]L}||krq
|jr*t d¡‚q
|js
|rF| |j|j¡}q
| |j|j¡}q
|S)zªgiven a list of mappers (assumed to be within this mapper's
        inheritance hierarchy), construct an outerjoin amongst those mapper's
        mapped tables.
 
        z^'with_polymorphic()' requires 'selectable' argument when concrete-inheriting mappers are used.)    rÔrˆr¦rr¤rår}r€Z    outerjoin)r¼rr‘Zfrom_objr]rkrkrlÚ_selectable_from_mappersé    s&ÿÿÿzMapper._selectable_from_mapperscCsL|j}|dkrdSt|tƒs dS|jdk    pF|jdk    oF|jj oF|jj SdS)NFT)rƒr¢r@Úserver_defaultÚdefaultZ    is_scalarZ is_callable)r¼Zvid_colrkrkrlÚ!_version_id_has_server_side_value
s
 
 
 
üz(Mapper._version_id_has_server_side_valuecCsB|jr:|jr:|jdk    r:|j ||dœ¡ dd„|jDƒ¡SdSdS)N)Ú parententityÚ parentmappercSsg|]}|js|j‘qSrk)rŠr‡rŒrkrkrlr"
sþz2Mapper._single_table_criterion.<locals>.<listcomp>)r¤rr…Ú    _annotateÚin_rórÄrkrkrlÚ_single_table_criterion
sÿþý
zMapper._single_table_criterioncCs|jot|jdtjƒS)zÃreturn True if with_polymorphic[1] is an aliased fromclause,
        like a subquery.
 
        As of #8168, polymorphic adaption with ORMAdapter is used only
        if this is present.
 
        r)r‰r¢r9ZAliasedReturnsRowsrÄrkrkrlÚ#_has_aliased_polymorphic_fromclause'
s    þz*Mapper._has_aliased_polymorphic_fromclausecCs|jp|jp|jjp|jjS)a;determine if _MapperEntity or _ORMColumnEntity will need to use
        polymorphic adaption when setting up a SELECT as well as fetching
        rows for mapped classes and subclasses against this Mapper.
 
        moved here from context.py for #8456 to generalize the ruleset
        for this condition.
 
        )r›r®r×rÄrkrkrlÚ _should_select_with_poly_adapter5
s+ÿþüz'Mapper._should_select_with_poly_adaptercCs| ¡|jsgS|j|jŽSrh)rjr‰rrÄrkrkrlÚ_with_polymorphic_mappersf
sz Mapper._with_polymorphic_mapperscCs | ¡dS)zðThis hook is invoked by attribute inspection.
 
        E.g. when Query calls:
 
            coercions.expect(roles.ColumnsClauseRole, ent, keep_inspect=True)
 
        This allows the inspection process run a configure mappers hook.
 
        N)rjrÄrkrkrlÚ _post_inspectn
s zMapper._post_inspectcCs:|js |jS|j\}}|dk    r"|S| | ||¡d¡SdS©NF)r‰rÔr’r)r¼rŠr‹rkrkrlÚ_with_polymorphic_selectable{
s
 
ÿz#Mapper._with_polymorphic_selectablecCsdd„|j ¡DƒS)NcSs$i|]\}}|tdd„|Dƒƒ“qS)css|]}|jjr|VqdSrh)rœÚshould_evaluate_noner rkrkrlr‘
szAMapper._insert_cols_evaluating_none.<locals>.<dictcomp>.<genexpr>©rL©rrÀrØrkrkrlÚ
<dictcomp>
s
ýÿz7Mapper._insert_cols_evaluating_none.<locals>.<dictcomp>©rÍrôrÄrkrkrlÚ_insert_cols_evaluating_noneŽ
süz#Mapper._insert_cols_evaluating_nonecCsdd„|j ¡DƒS)NcSs$i|]\}}|tdd„|Dƒƒ“qS)css.|]&}|js|js|js|jjs|jVqdSrh)r~r“r”rœr¡rør rkrkrlrš
s ûz9Mapper._insert_cols_as_none.<locals>.<dictcomp>.<genexpr>r¢r£rkrkrlr¤™
s
    øþz/Mapper._insert_cols_as_none.<locals>.<dictcomp>r¥rÄrkrkrlÚ_insert_cols_as_none—
s    ÷zMapper._insert_cols_as_nonecs‡fdd„ˆj ¡DƒS)Ncs$i|]\}}|‡fdd„|Dƒ“qS)csi|]}ˆj|j|“qSrk©rÐrør rÄrkrlr¤¨
s
z5Mapper._propkey_to_col.<locals>.<dictcomp>.<dictcomp>rkr£rÄrkrlr¤§
sÿz*Mapper._propkey_to_col.<locals>.<dictcomp>r¥rÄrkrÄrlÚ_propkey_to_col¥
s
þzMapper._propkey_to_colcCsdd„|j ¡DƒS)NcSs$i|]\}}|tdd„|Dƒƒ“qS)cSsg|]
}|j‘qSrk©rør rkrkrlr"¯
sz7Mapper._pk_keys_by_table.<locals>.<dictcomp>.<listcomp>r¢©rrÀZpksrkrkrlr¤®
sÿz,Mapper._pk_keys_by_table.<locals>.<dictcomp>©rÌrôrÄrkrkrlÚ_pk_keys_by_table¬
sþzMapper._pk_keys_by_tablecs‡fdd„ˆj ¡DƒS)Ncs(i|] \}}|t‡fdd„|Dƒƒ“qS)csg|]}ˆj|j‘qSrkr¨r rÄrkrlr"¶
sz<Mapper._pk_attr_keys_by_table.<locals>.<dictcomp>.<listcomp>r¢r«rÄrkrlr¤µ
sÿz1Mapper._pk_attr_keys_by_table.<locals>.<dictcomp>r¬rÄrkrÄrlÚ_pk_attr_keys_by_table³
s
þzMapper._pk_attr_keys_by_tablez+Mapping[FromClause, FrozenSet[Column[Any]]]cCsdd„|j ¡DƒS)NcSs*i|]"\}}|tdd„td|ƒDƒƒ“qS)cSs,g|]$}|jdk    s$|jdk    r|jjr|‘qSrh)r“r”Úis_clause_elementr rkrkrlr"À
s
 
 
ûz:Mapper._server_default_cols.<locals>.<dictcomp>.<listcomp>úIterable[Column[Any]]©rLrr£rkrkrlr¤¾
s õþÿz/Mapper._server_default_cols.<locals>.<dictcomp>r¥rÄrkrkrlÚ_server_default_colsº
s ôzMapper._server_default_colscCsdd„|j ¡DƒS)NcSs*i|]"\}}|tdd„td|ƒDƒƒ“qS)cSs,g|]$}|jdk    s$|jdk    r|jjr|‘qSrh)Zserver_onupdateZonupdater¯r rkrkrlr"Ó
s
 
 
ûzCMapper._server_onupdate_default_cols.<locals>.<dictcomp>.<listcomp>r°r±r£rkrkrlr¤Ñ
s õþÿz8Mapper._server_onupdate_default_cols.<locals>.<dictcomp>r¥rÄrkrkrlÚ_server_onupdate_default_colsÍ
s ôz$Mapper._server_onupdate_default_colsz#Mapping[FromClause, FrozenSet[str]]cCsdd„|j ¡DƒS)NcSs$i|]\}}|tdd„|Dƒƒ“qS)css|]}|jdk    r|jVqdSrhrªr rkrkrlrã
s
z=Mapper._server_default_col_keys.<locals>.<dictcomp>.<genexpr>r¢©rrÀÚcolsrkrkrlr¤â
sÿz3Mapper._server_default_col_keys.<locals>.<dictcomp>)r²rôrÄrkrkrlr¾à
sþzMapper._server_default_col_keyscCsdd„|j ¡DƒS)NcSs$i|]\}}|tdd„|Dƒƒ“qS)css|]}|jdk    r|jVqdSrhrªr rkrkrlrì
s
zFMapper._server_onupdate_default_col_keys.<locals>.<dictcomp>.<genexpr>r¢r´rkrkrlr¤ë
sÿz<Mapper._server_onupdate_default_col_keys.<locals>.<dictcomp>)r³rôrÄrkrkrlÚ!_server_onupdate_default_col_keysç
sþz(Mapper._server_onupdate_default_col_keyszSet[str]csttƒ}|j‰|j ¡D]&\}}| ‡fdd„| ˆ¡Dƒ¡q|j ¡D]&\}}| ‡fdd„| ˆ¡Dƒ¡qH|S)Nc3s|]}ˆ|jVqdSrhrªr ©Zcol_to_propertyrkrlrö
sÿz@Mapper._server_default_plus_onupdate_propkeys.<locals>.<genexpr>c3s|]}ˆ|jVqdSrhrªr r·rkrlrû
sÿ)rjrÐr²rôròr,r³)r¼ÚresultrÀrØrkr·rlÚ&_server_default_plus_onupdate_propkeysð
sþ
þ
z-Mapper._server_default_plus_onupdate_propkeyscCsT|||dœ}|j|jk    r<|j |||dœ¡ d|dœ¡|d<|j |¡ d|dœ¡S)N)Úentity_namespacer–r—Úorm©Zcompile_state_pluginZplugin_subjectZ    dml_table)rÔr}r˜Ú_set_propagate_attrsr‹)r¼rrkrkrlÚ__clause_element__ s ý ýÿù
ÿzMapper.__clause_element__cCs$t ¡ |||ddœ¡ d|dœ¡S)NT)rºr–r—Úidentity_tokenr»r¼)r9Únullr˜r½rÄrkrkrlÚselect_identity_token süþ
öÿzMapper.select_identity_tokencCs|jS)a4The :class:`_schema.FromClause` construct this
        :class:`_orm.Mapper` selects from by default.
 
        Normally, this is equivalent to :attr:`.persist_selectable`, unless
        the ``with_polymorphic`` feature is in use, in which case the
        full "polymorphic" selectable is returned.
 
        )r rÄrkrkrlr‹+ s
zMapper.selectablez)Union[Literal[(False, None)], FromClause]z(Tuple[Sequence[Mapper[Any]], FromClause])rŠr‹r‘rgcCs~|dkrtjtj|dd}|jrB|s.|jd}|dkrN|jd}n |dkrNd}| ||¡}|dk    rj||fS|| ||¡fSdS)NrŸTrërFr)r8r£r;r¥r‰rr’)r¼rŠr‹r‘rrkrkrlÚ_with_polymorphic_args7 s"ÿ
  zMapper._with_polymorphic_argscCst| |j¡ƒSrh)ríÚ_iterate_polymorphic_propertiesrrÄrkrkrlÚ_polymorphic_propertiesO s
ÿÿzMapper._polymorphic_propertiescs|j}|j‰‡fdd„|DƒS)Ncs<g|]4}t|tjƒr|jrˆr.ˆj|jdn|jd‘qS©r)r¢rrQZ_renders_in_subqueriesrØ©rrù©Úadapterrkrlr"\ s ýz2Mapper._all_column_expressions.<locals>.<listcomp>)rÄÚ_polymorphic_adapter)r¼Úpoly_propertiesrkrÇrlÚ_all_column_expressionsW s
 
þzMapper._all_column_expressionsrkcCs$|r| |¡}n|j}dd„|DƒS)NcSs(g|] }t|tjƒr|j|jdf‘qSrÅ)r¢rrQrørØrÆrkrkrlr"k s þz-Mapper._columns_plus_keys.<locals>.<listcomp>)rÃrÄ)r¼Zpolymorphic_mappersrÊrkrkrlÚ_columns_plus_keysc sÿþzMapper._columns_plus_keyszOptional[orm_util.ORMAdapter]cCs*|jr"tjtjj||j|jddSdSdS)NF)r‹Z equivalentsZlimit_on_entity)r›Úorm_utilrTZ_TraceAdaptRoleZMAPPER_POLYMORPHIC_ADAPTERr‹Ú_equivalent_columnsrÄrkrkrlrÉq sûzMapper._polymorphic_adapterccs||dkr|j}|s&|jD]
}|VqnRt tdd„|g|DƒŽ¡D]2}t|ddƒrp|jdksD|jd|jk    rpqD|VqDdS)zUReturn an iterator of MapperProperty objects which will render into
        a SELECT.NcSsg|]}t|jƒ‘qSrk)rír‰)rrÅrkrkrlr" sÿz:Mapper._iterate_polymorphic_properties.<locals>.<listcomp>rVFr)rr‰r Z unique_listrrDr…rØ)r¼rrÙrkrkrlrÃ~ s&
 
þÿÿ ÿþz&Mapper._iterate_polymorphic_propertiesz,util.ReadOnlyProperties[MapperProperty[Any]]cCs| ¡t |j¡S)aiA namespace of all :class:`.MapperProperty` objects
        associated this mapper.
 
        This is an object that provides each property based on
        its key name.  For instance, the mapper for a
        ``User`` class which has ``User.name`` attribute would
        provide ``mapper.attrs.name``, which would be the
        :class:`.ColumnProperty` representing the ``name``
        column.   The namespace object can also be iterated,
        which would yield each :class:`.MapperProperty`.
 
        :class:`_orm.Mapper` has several pre-filtered views
        of this attribute which limit the types of properties
        returned, including :attr:`.synonyms`, :attr:`.column_attrs`,
        :attr:`.relationships`, and :attr:`.composites`.
 
        .. warning::
 
            The :attr:`_orm.Mapper.attrs` accessor namespace is an
            instance of :class:`.OrderedProperties`.  This is
            a dictionary-like object which includes a small number of
            named methods such as :meth:`.OrderedProperties.items`
            and :meth:`.OrderedProperties.values`.  When
            accessing attributes dynamically, favor using the dict-access
            scheme, e.g. ``mapper.attrs[somename]`` over
            ``getattr(mapper.attrs, somename)`` to avoid name collisions.
 
        .. seealso::
 
            :attr:`_orm.Mapper.all_orm_descriptors`
 
        )rjr ÚReadOnlyPropertiesrÎrÄrkrkrlÚattrsš s#z Mapper.attrsz'util.ReadOnlyProperties[InspectionAttr]cCst t|j ¡ƒ¡S)ay A namespace of all :class:`.InspectionAttr` attributes associated
        with the mapped class.
 
        These attributes are in all cases Python :term:`descriptors`
        associated with the mapped class or its superclasses.
 
        This namespace includes attributes that are mapped to the class
        as well as attributes declared by extension modules.
        It includes any Python descriptor type that inherits from
        :class:`.InspectionAttr`.  This includes
        :class:`.QueryableAttribute`, as well as extension types such as
        :class:`.hybrid_property`, :class:`.hybrid_method` and
        :class:`.AssociationProxy`.
 
        To distinguish between mapped attributes and extension attributes,
        the attribute :attr:`.InspectionAttr.extension_type` will refer
        to a constant that distinguishes between different extension types.
 
        The sorting of the attributes is based on the following rules:
 
        1. Iterate through the class and its superclasses in order from
           subclass to superclass (i.e. iterate through ``cls.__mro__``)
 
        2. For each class, yield the attributes in the order in which they
           appear in ``__dict__``, with the exception of those in step
           3 below.  In Python 3.6 and above this ordering will be the
           same as that of the class' construction, with the exception
           of attributes that were added after the fact by the application
           or the mapper.
 
        3. If a certain attribute key is also in the superclass ``__dict__``,
           then it's included in the iteration for that class, and not the
           class in which it first appeared.
 
        The above process produces an ordering that is deterministic in terms
        of the order in which attributes were assigned to the class.
 
        .. versionchanged:: 1.3.19 ensured deterministic ordering for
           :meth:`_orm.Mapper.all_orm_descriptors`.
 
        When dealing with a :class:`.QueryableAttribute`, the
        :attr:`.QueryableAttribute.property` attribute refers to the
        :class:`.MapperProperty` property, which is what you get when
        referring to the collection of mapped properties via
        :attr:`_orm.Mapper.attrs`.
 
        .. warning::
 
            The :attr:`_orm.Mapper.all_orm_descriptors`
            accessor namespace is an
            instance of :class:`.OrderedProperties`.  This is
            a dictionary-like object which includes a small number of
            named methods such as :meth:`.OrderedProperties.items`
            and :meth:`.OrderedProperties.values`.  When
            accessing attributes dynamically, favor using the dict-access
            scheme, e.g. ``mapper.all_orm_descriptors[somename]`` over
            ``getattr(mapper.all_orm_descriptors, somename)`` to avoid name
            collisions.
 
        .. seealso::
 
            :attr:`_orm.Mapper.attrs`
 
        )r rÏr¨rÖZ_all_sqla_attributesrÄrkrkrlÚall_orm_descriptorsÀ sB ÿzMapper.all_orm_descriptorszDict[str, str]cs2tjj‰dd„|jDƒ‰‡‡fdd„|j ¡DƒS)z~return a dictionary of {syn_attribute_name: pk_attr_name} for
        all synonyms that refer to primary key columns
 
        cSsh|]
}|j’qSrkrªrÆrkrkrlr) sz&Mapper._pk_synonyms.<locals>.<setcomp>cs0i|](\}}t|ˆjƒr|jˆkr|j|j“qSrk)r¢rMrrø)rr1r_©rTZpk_keysrkrlr¤ s
 
ýz'Mapper._pk_synonyms.<locals>.<dictcomp>)r rOrPr(rÎrôrÄrkrÒrlÚ _pk_synonyms s
 þzMapper._pk_synonymsz-util.ReadOnlyProperties[SynonymProperty[Any]]cCstjj}| |j¡S)zûReturn a namespace of all :class:`.Synonym`
        properties maintained by this :class:`_orm.Mapper`.
 
        .. seealso::
 
            :attr:`_orm.Mapper.attrs` - namespace of all
            :class:`.MapperProperty`
            objects.
 
        )r rOrPÚ_filter_propertiesrM)r¼rTrkrkrlÚsynonyms s zMapper.synonymscCs|jSrhrÆrÄrkrkrlrº) szMapper.entity_namespacez,util.ReadOnlyProperties[ColumnProperty[Any]]cCs | tj¡S)aReturn a namespace of all :class:`.ColumnProperty`
        properties maintained by this :class:`_orm.Mapper`.
 
        .. seealso::
 
            :attr:`_orm.Mapper.attrs` - namespace of all
            :class:`.MapperProperty`
            objects.
 
        )rÔrrQrÄrkrkrlÚ column_attrs- s zMapper.column_attrszsqlalchemy.orm.relationshipsz2util.ReadOnlyProperties[RelationshipProperty[Any]]cCs| tjjj¡S)aDA namespace of all :class:`.Relationship` properties
        maintained by this :class:`_orm.Mapper`.
 
        .. warning::
 
            the :attr:`_orm.Mapper.relationships` accessor namespace is an
            instance of :class:`.OrderedProperties`.  This is
            a dictionary-like object which includes a small number of
            named methods such as :meth:`.OrderedProperties.items`
            and :meth:`.OrderedProperties.values`.  When
            accessing attributes dynamically, favor using the dict-access
            scheme, e.g. ``mapper.relationships[somename]`` over
            ``getattr(mapper.relationships, somename)`` to avoid name
            collisions.
 
        .. seealso::
 
            :attr:`_orm.Mapper.attrs` - namespace of all
            :class:`.MapperProperty`
            objects.
 
        )rÔr rOZorm_relationshipsrRrÄrkrkrlÚ relationships; sÿzMapper.relationshipsz/util.ReadOnlyProperties[CompositeProperty[Any]]cCs| tjjj¡S)zýReturn a namespace of all :class:`.Composite`
        properties maintained by this :class:`_orm.Mapper`.
 
        .. seealso::
 
            :attr:`_orm.Mapper.attrs` - namespace of all
            :class:`.MapperProperty`
            objects.
 
        )rÔr rOrPrLrÄrkrkrlÚ
compositesZ s ÿzMapper.compositesz    Type[_MP]zutil.ReadOnlyProperties[_MP])Útype_rgcs,| ¡t t ‡fdd„|j ¡Dƒ¡¡S)Nc3s$|]\}}t|ˆƒr||fVqdSrh)r¢©rr1Úv©rÙrkrlrp s
z,Mapper._filter_properties.<locals>.<genexpr>)rjr rÏr9rÎrô)r¼rÙrkrÜrlrÔk s ÿÿzMapper._filter_propertiescCs4dd„t|jdƒDƒ}tjdd„|DƒŽt |¡fS)z¢create a "get clause" based on the primary key.  this is used
        by query.get() and many-to-one lazyloads to load this item
        by primary key.
 
        cSs(g|] \}}|tjd||jdf‘qS)zpk_%drÜ)r4Ú    bindparamrœ)rÚidxr~rkrkrlr"| sýþz&Mapper._get_clause.<locals>.<listcomp>rcSsg|]\}}||k‘qSrkrkrÚrkrkrlr"„ s)Ú    enumerater~r4Úand_r Z column_dict)r¼ÚparamsrkrkrlÚ _get_clauseu s 
ûþzMapper._get_clauserXcs@i‰‡fdd„}|jjD]"}|jdk    rt |jid|i¡qˆS)a©Create a map of all equivalent columns, based on
        the determination of column pairs that are equated to
        one another based on inherit condition.  This is designed
        to work with the queries that util.polymorphic_union
        comes up with, which often don't include the columns from
        the base table directly (including the subclass table columns
        only).
 
        The resulting structure is a dictionary of columns mapped
        to lists of equivalent columns, e.g.::
 
            {
                tablea.col1:
                    {tableb.col1, tablec.col1},
                tablea.col2:
                    {tabled.col2}
            }
 
        csh|jtjkrd|jˆkr*ˆ|j |j¡n|jhˆ|j<|jˆkrVˆ|j |j¡n|jhˆ|j<dSrh)Úoperatorr:ÚeqÚleftr-Úright)Úbinary©r¸rkrlÚ visit_binaryŸ s 
 
z0Mapper._equivalent_columns.<locals>.visit_binaryNrç)r×rór€r=Útraverse)r¼rérÅrkrèrlrΈ s 
ÿzMapper._equivalent_columns)Ú assigned_nameÚobjrgcCs&t|ttjtjfƒrdS||jkSdSrŸ)r¢r'rrOr9r[Ú_dataclass_fields)r¼rërìrkrkrlÚ_is_userland_descriptor² sýþzMapper._is_userland_descriptorcCsdd„t |j¡DƒS)NcSsg|]
}|j‘qSrk)r)rÚfrkrkrlr"Á sz,Mapper._dataclass_fields.<locals>.<listcomp>)r Zdataclass_fieldsr|rÄrkrkrlrí¿ szMapper._dataclass_fieldscCsâ|dk    rt |¡rdS|rH|jj |d¡dk    rn| ||jj|¡rndSn&|j |d¡}|dk    rn| ||¡rndS|jdk    r¦||jkr¦|dks”||jkr¦|     d|¡dS|j
dk    rÞ||j
ksÌ|dk    rÞ||j
krÞ|     d|¡dSdS)zödetermine whether a particular property should be implicitly
        present on the class.
 
        This occurs when properties are propagated from an inherited class, or
        are applied from the columns present in the mapped table.
 
        NTznot including property %szexcluding property %sF) r8Z_never_select_columnr|rr<rîrÖrQrrºr)r¼rrërðrñÚattrrkrkrlrõà sR    ÿþ
ÿþ ÿÿþýý
ÿþþzMapper._should_exclude)ÚotherrgcCs |j|jkS)zXReturn true if the given mapper shares a
        common inherited parent as this mapper.)rשr¼rñrkrkrlÚ common_parentñ szMapper.common_parentcCs$|j|jko"| |¡ o"| |¡ S)z{return true if the other mapper is an inheriting sibling to this
        one.  common parent but different branch
 
        )r×rŽròrkrkrlÚ
is_sibling÷ s
 
ÿ
ýzMapper.is_siblingzInstanceState[Any])r@Úallow_subtypesrgcCs4| ¡}|jdk    s|r$t|ƒ |¡St|ƒ|kSdSrh)Úprimary_mapperr…r$rŽ)r¼r@rõÚsrkrkrlÚ_canload szMapper._canloadcCs |}|r||k    r|j}qt|ƒS)z>Return True if the this mapper inherits from the given mapper.)rrz)r¼rñr]rkrkrlrŽ s z
Mapper.isarnccs|}|r|V|j}qdSrh)r)r¼r]rkrkrlrá szMapper.iterate_to_rootcCs<g}t|gƒ}|r2| ¡}| |¡| |j¡qt |¡S)z¿The collection including this mapper and all descendant mappers.
 
        This includes not just the immediately inheriting mappers but
        all their inheriting mappers as well.
 
        )rrHrçrIrÉr rÞ)r¼Z descendantsrJrKrkrkrlró s
 
zMapper.self_and_descendantscCs
t|jƒS)aCIterate through the collection including this mapper and
        all descendant mappers.
 
        This includes not just the immediately inheriting mappers but
        all their inheriting mappers as well.
 
        To iterate through an entire hierarchy, use
        ``mapper.base_mapper.polymorphic_iterator()``.
 
        )rˆrórÄrkrkrlÚpolymorphic_iterator) s zMapper.polymorphic_iteratorcCs|jjS)zSReturn the primary mapper corresponding to this mapper's class key
        (class).)rÖrÅrÄrkrkrlrö6 szMapper.primary_mappercCs
|jjjSrh)rÖrÅr×rÄrkrkrlÚprimary_base_mapper< szMapper.primary_base_mappercs@|j}ˆr‡fdd„|Dƒ}| ¡}|D]}||kr(dSq(dS)Ncsg|]}ˆj|‘qSrk©rØr$rÇrkrlr"C sz3Mapper._result_has_identity_key.<locals>.<listcomp>FT)r~Úkeys)r¼r¸rÈr0Zrkr!rkrÇrlÚ_result_has_identity_key@ szMapper._result_has_identity_keyz%Optional[Union[Row[Any], RowMapping]]zOptional[ORMAdapter]z_IdentityKeyType[_O])Úrowr¿rÈrgcsV|j}ˆr‡fdd„|Dƒ}t|dƒr.|j‰n
td|ƒ‰|jt‡fdd„|Dƒƒ|fS)a…Return an identity-map key for use in storing/retrieving an
        item from the identity map.
 
        :param row: A :class:`.Row` or :class:`.RowMapping` produced from a
         result set that selected from the ORM mapped primary key columns.
 
         .. versionchanged:: 2.0
            :class:`.Row` or :class:`.RowMapping` are accepted
            for the "row" argument
 
        csg|]}ˆj|‘qSrkrûr$rÇrkrlr"^ sz0Mapper.identity_key_from_row.<locals>.<listcomp>Ú_mappingzMapping[Any, Any]c3s|]}ˆ|VqdSrhrk)rrñ)Úmappingrkrlrg sz/Mapper.identity_key_from_row.<locals>.<genexpr>)r~r    rÿrrÈrì)r¼rþr¿rÈr0rk)rÈrrlÚidentity_key_from_rowK s
 
ýzMapper.identity_key_from_rowzTuple[Any, ...])r~r¿rgcCs|jt|ƒ|fS)z±Return an identity-map key for use in storing/retrieving an
        item from an identity map.
 
        :param primary_key: A list of values indicating the identifier.
 
        )rÈrì)r¼r~r¿rkrkrlÚidentity_key_from_primary_keyk s ýz$Mapper.identity_key_from_primary_keyr!)ÚinstancergcCst |¡}| |tj¡S)aÈReturn the identity key for the given instance, based on
        its primary key attributes.
 
        If the instance's state is expired, calling this method
        will result in a database check to see if the object has been deleted.
        If the row no longer exists,
        :class:`~sqlalchemy.orm.exc.ObjectDeletedError` is raised.
 
        This value is typically also found on the instance state under the
        attribute name `key`.
 
        ©rÚinstance_stateÚ_identity_key_from_stater%Ú PASSIVE_OFF)r¼rr@rkrkrlÚidentity_key_from_instance| s
z!Mapper.identity_key_from_instancer%)r@Úpassivergcs4ˆj‰ˆj‰|jt‡‡‡‡fdd„|jDƒƒˆjfS)Ncs"g|]}ˆ|jj ˆˆˆ¡‘qSrk)røÚimplr<rÆ©rArr    r@rkrlr"– sÿz3Mapper._identity_key_from_state.<locals>.<listcomp>)r¨rrÈrìr(r¿)r¼r@r    rkr rlrŒ sþÿøzMapper._identity_key_from_statecCs t |¡}| |tj¡}|dS)aGReturn the list of primary key values for the given
        instance.
 
        If the instance's state is expired, calling this method
        will result in a database check to see if the object has been deleted.
        If the row no longer exists,
        :class:`~sqlalchemy.orm.exc.ObjectDeletedError` is raised.
 
        rr)r¼rr@Z identity_keyrkrkrlÚprimary_key_from_instancež s
 
ÿz Mapper.primary_key_from_instancecs:dd„|jDƒ‰tˆƒ dg¡r.‡fdd„}ndd„}|S)NcSsg|] }|jj‘qSrk)rœZsort_key_functionr rkrkrlr"° sz1Mapper._persistent_sortkey_fn.<locals>.<listcomp>cstdd„tˆ|jdƒDƒƒS)Ncss&|]\}}|dk    r||ƒn|VqdSrhrk)rZkey_fnÚvalrkrkrlrµ sÿz=Mapper._persistent_sortkey_fn.<locals>.key.<locals>.<genexpr>r)rìÚziprø©r@©Zkey_fnsrkrlrø´ sþz*Mapper._persistent_sortkey_fn.<locals>.keycSs
|jdS©Nrrªrrkrkrlrø¼ s)r~rjÚ
differencer‚rkrrlÚ_persistent_sortkey_fn® s
zMapper._persistent_sortkey_fncs‡fdd„ˆjDƒS)Ncsg|]}ˆj|‘qSrkr†r rÄrkrlr"à sz.Mapper._identity_key_props.<locals>.<listcomp>r#rÄrkrÄrlr(Á szMapper._identity_key_propscCs&tƒ}|jD]}| |j|¡q |Srh)rjrÓròrÌ)r¼Z
collectionrÀrkrkrlÚ _all_pk_colsÅ s
zMapper._all_pk_colscCs$t|jƒ}|jdk    r | |j¡|Srh)rjr~r…r-)r¼rµrkrkrlÚ_should_undefer_in_wildcardÌ s
 
 z"Mapper._should_undefer_in_wildcardcs‡fdd„ˆjDƒS)Ncsh|]}ˆj|j’qSrkr¨r rÄrkrlr)Õ sz/Mapper._primary_key_propkeys.<locals>.<setcomp>)rrÄrkrÄrlÚ_primary_key_propkeysÓ szMapper._primary_key_propkeysrGúColumnElement[Any])r@rArñr    rgcCs$|j|}|j|jjj|||dS©N©r    )rÐrrør
r<©r¼r@rArñr    rùrkrkrlÚ_get_state_attr_by_column× s
z Mapper._get_state_attr_by_columncCs&|j|}|j|jj |||¡dSrh)rÐrrør
Zset_committed_value©r¼r@rArñrnrùrkrkrlÚ#_set_committed_state_attr_by_columná s
z*Mapper._set_committed_state_attr_by_columncCs(|j|}|j|jj |||d¡dSrh)rÐrrør
rjrrkrkrlÚ_set_state_attr_by_columnå s
z Mapper._set_state_attr_by_columncCs(t |¡}t |¡}|j|||tjdSr)rrÚ instance_dictÚ#_get_committed_state_attr_by_columnr%r)r¼rìrñr@rArkrkrlÚ_get_committed_attr_by_columné s
 
ÿz$Mapper._get_committed_attr_by_columncCs$|j|}|j|jjj|||dSr)rÐrrør
Zget_committed_valuerrkrkrlr ð s 
ÿz*Mapper._get_committed_state_attr_by_columnc sXˆj‰t|ƒ ˆjj ¡¡}tt‡fdd„|DƒŽƒ‰ˆjjˆkrFdS‡‡‡fdd„}g}d}t    t
ˆ  ¡ƒƒD]l}|jˆkr‚d}nt |jt jƒs–dS|rn|jsn|jsªt‚|jr´t‚|jdk    sÂt‚| |j¡ˆ |j¡qnzt |did    |i¡}Wntk
rYdSX||d<tj|Ž}    g}
|D]} |
 ˆ| j¡q*tj|
Ž |    ¡ t ¡S)
alassemble a WHERE clause which retrieves a given state by primary
        key, using a minimized set of tables.
 
        Applies to a joined-table inheritance mapper where the
        requested attribute names are only present on joined tables,
        not the base table.  The WHERE clause attempts to include
        only those tables to minimize joins.
 
        cs*g|]"}ˆ|jD]}tj|dd‘qqS)T)Z check_columns)rØrâr*)rrørÙ)Úpropsrkrlr"
s þz3Mapper._optimized_get_statement.<locals>.<listcomp>Ncs²|j}|j}|dks|dkr dS|jˆkrhˆjˆˆj|tjd}|tjkrPt    ƒ‚t
j d||jj d|_nF|jˆkr®ˆjˆˆj|tjd}|tjkr˜t    ƒ‚t
j d||jj d|_dS)NrrÜ) rårærÀr r¨r%ZPASSIVE_NO_INITIALIZErÍZ    _none_setÚ_OptGetColumnsNotAvailabler4rÝrœ)rçZleftcolZrightcolZleftvalZrightval)r¼r@rÓrkrlrés@
ü
ÿ
 
ü
ÿz5Mapper._optimized_get_statement.<locals>.visit_binaryFTrrç)!rÎrjr,rÅrÖrürr×r}Úreversedrírár¢r9r<r¤rrãrˆr€rçr-r=Zcloned_traverser#r4ràrIrØÚselectÚwhereÚset_label_stylerB) r¼r@Zattribute_namesZcol_attribute_namesréZallcondsÚstartrÅZ
_traversedZcondrµrørk)r"r¼r@rÓrlÚ_optimized_get_statementù s\
 
ÿ
þÿÿ
 
 
 
 
 ÿ
 
ÿþÿzMapper._optimized_get_statementccsL| |¡rH|}| ¡D]0}|V||k    r6||jkr6qH|}||krqHqdSrh)rŽrár)r¼rÅÚprevr]rkrkrlÚ_iterate_to_target_viawpoly_s
 z"Mapper._iterate_to_target_viawpolycCsiSrhrkrÄrkrkrlÚ&_would_selectinload_combinations_cachelsz-Mapper._would_selectinload_combinations_cachecCsn|j}z
||WStk
r$YnX| |¡s4t‚|}| |¡D]}|jdkrB||k}qbqBd}|||<|S)aÓreturn True if this mapper would "selectin" polymorphic load based
        on the given super mapper, and not from a setting from a subclass.
 
        given::
 
            class A:
                ...
 
            class B(A):
                __mapper_args__ = {"polymorphic_load": "selectin"}
 
            class C(B):
                ...
 
            class D(B):
                __mapper_args__ = {"polymorphic_load": "selectin"}
 
        ``inspect(C)._would_selectin_load_only_from_given_mapper(inspect(B))``
        returns True, because C does selectin loading because of B's setting.
 
        OTOH, ``inspect(D)
        ._would_selectin_load_only_from_given_mapper(inspect(B))``
        returns False, because D does selectin loading because of its own
        setting; when we are doing a selectin poly load from B, we want to
        filter out D because it would already have its own selectin poly load
        set up separately.
 
        Added as part of #9373.
 
        rÝF)r,rrŽrãr+r‹)r¼Z super_mapperÚcacherÅr]ÚretvalrkrkrlÚ+_would_selectin_load_only_from_given_mapperps
 
z2Mapper._would_selectin_load_only_from_given_mappercCs”|s,|}| |¡D]}|jdkr|Sqndt|ƒ}dd„|Dƒ}| |g¡D]@}|j}| |¡D]*}|jdksx||krb| ||¡SqbqNdS)NrÝcSsi|] }|j|“qSrk©rÅ)rÚerkrkrlr¤±sz0Mapper._should_selectin_load.<locals>.<dictcomp>)r+r‹rjr rÅr<)r¼Zenabled_via_optÚpolymorphic_fromrÅr]Zenabled_via_opt_mappersrÇrkrkrlÚ_should_selectin_load§s 
 ÿþzMapper._should_selectin_loadzsqlalchemy.orm.strategy_optionscsàtjj}|jst‚|jdk    r:|j|j}t|g|jƒ}n
t|jƒ}|     ˆ¡}|     ˆ¡}|h}|j}    |    dk    r|    |k    r|    j
dkr|  |    ¡|    j}    qd|j D]t}
|
j |jkr¨q–|
j|ksº|
|krêt|
tƒsÆq–|jtˆj|
j ƒft|
jƒdd}q–|jtˆj|
j ƒfddidd}q–dd„|jDƒ} t| ƒd    kr6tj| Ž} n| d
} ˆjr¦ˆj|ksVt‚t ˆ¡ t¡} ˆj  !| ¡} ‡fd d„| Dƒ} |  "|  #tj$d dd ¡¡j%| Ž} n0t |¡ t¡} |  "|  #tj$d dd ¡¡j%| Ž} | ||fS)zbAssemble a that can load the columns local to
        this subclass as a SELECT with IN.
 
        NrÝT)Z_reconcile_to_otherZ
do_nothingFcSsg|]}t |ddi¡‘qS)Z
_orm_adaptT)râZ_deep_annotate)rÚpkrkrkrlr"ýsÿz0Mapper._subclass_load_via_in.<locals>.<listcomp>rrcsg|]}ˆj |¡‘qSrk)Ú_adapterrê)rr1©rÇrkrlr"sZ primary_keys)Z    expanding)&r rOZorm_strategy_optionsrrãr…rÐrjr(ÚLoadr‹r-rÐrørÖrRr¢r-Z_set_generic_strategyrDrºr¨Z strategy_keyr~r.r4Útuple_Zis_aliased_classrÅr%r'rBr5rêr&r™rÝZorder_by)r¼rÇr2Zstrategy_optionsZpolymorphic_propZ
keep_propsZ disable_optZ
enable_optZclasses_to_includer]rùr~Zin_exprÚqrkr6rlÚ_subclass_load_via_in½sz
 
 
 
 
ÿþý
 
 
ú ú    þ 
ÿ ÿþ
ÿÿþzMapper._subclass_load_via_incCs| ||j¡Srh)r:r×rÄrkrkrlÚ_subclass_load_via_in_mapper sz#Mapper._subclass_load_via_in_mapperz.Optional[Callable[[InstanceState[Any]], bool]]zGIterator[Tuple[object, Mapper[Any], InstanceState[Any], _InstanceDict]])rÙr@Úhalt_onrgccstƒ}tƒtƒ}}|j |¡s$t‚tt|jj ¡ƒ|||jfgƒ}|r|d\}}    }
} |sh|     ¡qD|    |krÐ| 
¡} | j rD|| j krŠqD|
dk    s–t‚| dk    s¢t‚t|   ||
| ||¡ƒ} | rÎ|  | |ddf¡qD|    |krD| 
¡\}}}}||||fV|  t|j ¡ƒ|||f¡qDdS)a.Iterate each element and its mapper in an object graph,
        for all relationships that meet the given cascade rule.
 
        :param type\_:
          The name of the cascade rule (i.e. ``"save-update"``, ``"delete"``,
          etc.).
 
          .. note::  the ``"all"`` cascade is not accepted here.  For a generic
             object traversal function, see :ref:`faq_walk_objects`.
 
        :param state:
          The lead InstanceState.  child items will be processed per
          the relationships defined for this object's mapper.
 
        :return: the method yields individual object instances.
 
        .. seealso::
 
            :ref:`unitofwork_cascades`
 
            :ref:`faq_walk_objects` - illustrates a generic function to
            traverse all objects without relying on cascades.
 
        rbN)rjÚobjectrÅrŽrãrrÎrMr¨rrHrgÚcascade_iteratorrç)r¼rÙr@r<Zvisited_statesZprpZmppZ
visitablesÚiteratorZ    item_typeZ parent_stateZ parent_dictrùÚqueuerZinstance_mapperZcorresponding_stateZcorresponding_dictrkrkrlr>%s^  ÿ  ûÿ    ûü üÿzMapper.cascade_iteratorcCs t |j¡Srh)r ZLRUCacher–rÄrkrkrlÚ_compiled_cache†szMapper._compiled_cachecCst|jƒdkSr)r.rÓrÄrkrkrlÚ_multiple_persistence_tablesŠsz#Mapper._multiple_persistence_tablescs¢i‰|jjD]}|jD]}ˆ ||¡qq g}ˆ ¡D],\‰}|j}|r6| ‡fdd„|jDƒ¡q6‡fdd„}tjˆ||d}t     
¡}|D]}ˆ|||<qŒ|S)Ncsg|] }|ˆf‘qSrkrk)rZ super_tabler'rkrlr"›sz)Mapper._sorted_tables.<locals>.<listcomp>csŒˆ |jj¡}ˆ |jj¡}|dk    rˆ|dk    rˆ||k    rˆ|jdk    rˆtt |j¡ƒ}|jdk    r~| t |j¡¡}|j|ko||j|kS|j|kSdSrŸ)    r<rRrÀrñr€rjrâZ _find_columnsr )ZfkrRÚdeprµ)Útable_to_mapperrkrlÚskipžs$ÿþýü
 
ÿ
z#Mapper._sorted_tables.<locals>.skip)Zskip_fnÚextra_dependencies) r×rórÓÚ
setdefaultrôrrIrâZ sort_tablesr r9)r¼rÅrrFZsuper_rEZsorted_Úretrk)rÀrDrlÚ_sorted_tablesŽs* 
ÿ ýzMapper._sorted_tableszCallable[[], _T]r^)røÚ    callable_rgcCs2||jkrtt|j|ƒS|ƒ|j|<}|SdSrh)r°rr^)r¼rørJrnrkrkrlÚ_memoÁs
z Mapper._memocCspt t¡}dd„}|jD]R}t|jƒ}| ¡D]:}|jr.| t    |dd„|jDƒƒ¡r.|| 
||jf¡q.q|S)zgmemoized map of tables to collections of columns to be
        synchronized upwards to the base mapper.cSs
| |¡Srh)r )r™ÚyrkrkrlÚ    set_union×sz+Mapper._table_to_equated.<locals>.set_unioncSsg|]\}}|j‘qSrkr)rrkÚrrkrkrlr"ász,Mapper._table_to_equated.<locals>.<listcomp>) r Ú defaultdictrírIrjrÙrár¯r,rrç)r¼r¸rMrÀrµr]rkrkrlÚ_table_to_equatedÈs ø
 
 
 
þÿzMapper._table_to_equated)NNNFNNNFNNNNNFNFNTTNNNTFTrxFry)F)NN)F)NFF)rk)N)N)NN)N)N)—ržrÚ __qualname__Ú__doc__Ú__annotations__rrurr Zdeprecated_paramsr½rÁrÂZ    is_mapperZrepresents_outer_joinÚpropertyrÅrÇrÕZnon_memoized_propertyÚ
deprecatedrÚZmemoized_propertyrÛrµr²rèrúrûr¶rrr¹r·r¸rÒrCZmemoized_attributerGrCrNÚpreload_modulerör;r:r=rYZ langhelpersZtag_method_for_warningsr¦Z    SAWarningrjrlrormr»rtrºr{r}r~rrƒr…r‡r‰rr’r•ršr›rœrržrDr Zwith_polymorphic_mappersr¦r§r©r­r®r²r³r¾r¶r¹Zmemoized_instancemethodr¾rÁr‹rÂrÄrËrÌrÉrÃrÐrÑrÓrÕrºrÖr×rØrÔrârÎrîrírõrórôrørŽrárórùrörúrýrrrr%ZPASSIVE_RETURN_NO_VALUErr rr(rrrrrrr!r r)r+r,r/r3r:r;r>rArBrIrKrPrkrkrkrlrs¢sJ
  ÿ ÜJ 
              
 
 @'
]~q G
 
 
 
ù%úC$ü    ÿ
$
 
 
0
 
 
 
 
 
 ü   %E 
 
)  .      ü"#ýýû$
  ÿ     f  7 
bü a2rsrÃc@s eZdZdS)r#N)ržrrQrkrkrkrlr#ésr#cCsttƒdddS)aÀ Initialize the inter-mapper relationships of all mappers that
    have been constructed thus far across all :class:`_orm.registry`
    collections.
 
    The configure step is used to reconcile and initialize the
    :func:`_orm.relationship` linkages between mapped classes, as well as to
    invoke configuration events such as the
    :meth:`_orm.MapperEvents.before_configured` and
    :meth:`_orm.MapperEvents.after_configured`, which may be used by ORM
    extensions or user-defined extension hooks.
 
    Mapper configuration is normally invoked automatically, the first time
    mappings from a particular :class:`_orm.registry` are used, as well as
    whenever mappings are used and additional not-yet-configured mappers have
    been constructed. The automatic configuration process however is local only
    to the :class:`_orm.registry` involving the target mapper and any related
    :class:`_orm.registry` objects which it may depend on; this is
    equivalent to invoking the :meth:`_orm.registry.configure` method
    on a particular :class:`_orm.registry`.
 
    By contrast, the :func:`_orm.configure_mappers` function will invoke the
    configuration process on all :class:`_orm.registry` objects that
    exist in memory, and may be useful for scenarios where many individual
    :class:`_orm.registry` objects that are nonetheless interrelated are
    in use.
 
    .. versionchanged:: 1.4
 
        As of SQLAlchemy 1.4.0b2, this function works on a
        per-:class:`_orm.registry` basis, locating all :class:`_orm.registry`
        objects present and invoking the :meth:`_orm.registry.configure` method
        on each. The :meth:`_orm.registry.configure` method may be preferred to
        limit the configuration of mappers to those local to a particular
        :class:`_orm.registry` and/or declarative base class.
 
    Points at which automatic configuration is invoked include when a mapped
    class is instantiated into an instance, as well as when ORM queries
    are emitted using :meth:`.Session.query` or :meth:`_orm.Session.execute`
    with an ORM-enabled statement.
 
    The mapper configure process, whether invoked by
    :func:`_orm.configure_mappers` or from :meth:`_orm.registry.configure`,
    provides several event hooks that can be used to augment the mapper
    configuration step. These hooks include:
 
    * :meth:`.MapperEvents.before_configured` - called once before
      :func:`.configure_mappers` or :meth:`_orm.registry.configure` does any
      work; this can be used to establish additional options, properties, or
      related mappings before the operation proceeds.
 
    * :meth:`.MapperEvents.mapper_configured` - called as each individual
      :class:`_orm.Mapper` is configured within the process; will include all
      mapper state except for backrefs set up by other mappers that are still
      to be configured.
 
    * :meth:`.MapperEvents.after_configured` - called once after
      :func:`.configure_mappers` or :meth:`_orm.registry.configure` is
      complete; at this stage, all :class:`_orm.Mapper` objects that fall
      within the scope of the configuration operation will be fully configured.
      Note that the calling application may still have other mappings that
      haven't been produced yet, such as if they are in modules as yet
      unimported, and may also have mappings that are still to be configured,
      if they are in other :class:`_orm.registry` collections not part of the
      current scope of configuration.
 
    TrfN)rirmrkrkrkrlÚconfigure_mappersísDrWzSet[_RegistryType]rzrê)Ú
registriesrgrgc    Csž|D]}|jrqqdSthtr0W5QR£dSdazD|D]}|jr:q\q:W¢,W5QR£dStj t¡ ¡t||ƒW5daXW5QRXtj t¡ ¡dS)NTF)    rhriÚ_already_compilingrsrtZ
_for_classZbefore_configuredÚ_do_configure_registriesZafter_configured)rXrgrprkrkrlri4s"rizsqlalchemy.orm.decl_apic
Cs"tjjj}t|ƒ}| |¡D]þ}d}| ¡D]Æ}d}|jjD] }|||j    ƒ}|t
kr>d}q`q>|t
krjq.t |ddƒr–t   d||jf¡}    |j|    _|    ‚|js.z$| ¡| ¡|j ||j    ¡Wq.tk
ròt ¡d}
t|
dƒsì|
|_‚Yq.Xq.|sd|_|s|j |¡rt   d¡‚qdS)NFTruz’One or more mappers failed to initialize - can't proceed with initialization of other mappers. Triggering mapper: '%s'. Original exception was: %srzHconfigure was called with cascade=False but additional registries remain)r rOÚ orm_decl_apirJrjZ_recurse_with_dependenciesrortZbefore_mapper_configuredr|r(rDr¦rrurÕrlr»Zmapper_configuredÚ    ExceptionÚsysÚexc_infor    rhÚ _dependenciesr) rXrgrJÚorigrpZhas_skiprÅZ run_configureÚfnr1rrkrkrlrZWsJ
    üÿ 
 
ÿrZc    Cs¶tjjj}t|ƒ}| |¡D]”}|s:|j |¡r:t     d¡‚|j
rtz|j
  ¡\}}Wnt k
rfYq:X|  |¡q:|j ¡|j ¡|jD]}|j |¡qŽ|j ¡d|_qdS)Nz^Registry has dependent registries that are not disposed; pass cascade=True to clear these alsoF)r rOr[rJrjZ_recurse_with_dependentsZ _dependentsrr¦rZ    _managersÚpopitemrZ_dispose_manager_and_mapperZ_non_primary_mappersÚclearr_Údiscardrh)rXrgrJr`rprÚ_rCrkrkrlÚ_dispose_registriess&
ÿ 
 
 
 
rfcCs
d|_|S)a¹Decorate a method as the 'reconstructor' hook.
 
    Designates a single method as the "reconstructor", an ``__init__``-like
    method that will be called by the ORM after the instance has been
    loaded from the database or otherwise reconstituted.
 
    .. tip::
 
        The :func:`_orm.reconstructor` decorator makes use of the
        :meth:`_orm.InstanceEvents.load` event hook, which can be
        used directly.
 
    The reconstructor will be invoked with no arguments.  Scalar
    (non-collection) database-mapped attributes of the instance will
    be available for use within the function.  Eagerly-loaded
    collections are generally not yet available and will usually only
    contain the first element.  ORM state changes made to objects at
    this stage will not be recorded for the next flush() operation, so
    the activity within a reconstructor should be conservative.
 
    .. seealso::
 
        :meth:`.InstanceEvents.load`
 
    T)r©rarkrkrlÚ reconstructor°srh©Úinclude_removesÚinclude_backrefsrîzCallable[[_Fn], _Fn])Únamesrjrkrgcsdddœ‡‡‡fdd„ }|S)aÎDecorate a method as a 'validator' for one or more named properties.
 
    Designates a method as a validator, a method which receives the
    name of the attribute as well as a value to be assigned, or in the
    case of a collection, the value to be added to the collection.
    The function can then raise validation exceptions to halt the
    process from continuing (where Python's built-in ``ValueError``
    and ``AssertionError`` exceptions are reasonable choices), or can
    modify or replace the value before proceeding. The function should
    otherwise return the given value.
 
    Note that a validator for a collection **cannot** issue a load of that
    collection within the validation routine - this usage raises
    an assertion to avoid recursion overflows.  This is a reentrant
    condition which is not supported.
 
    :param \*names: list of attribute names to be validated.
    :param include_removes: if True, "remove" events will be
     sent as well - the validation function must accept an additional
     argument "is_remove" which will be a boolean.
 
    :param include_backrefs: defaults to ``True``; if ``False``, the
     validation function will not emit if the originator is an attribute
     event related via a backref.  This can be used for bi-directional
     :func:`.validates` usage where only one validator should emit per
     attribute operation.
 
    .. seealso::
 
      :ref:`simple_validators` - usage examples for :func:`.validates`
 
    rb)rargcsˆ|_ˆˆdœ|_|S)Nri)rr rg©rkrjrlrkrlÚwrapòs
þzvalidates.<locals>.wraprk)rjrkrlrnrkrmrlÚ    validatesÎs$rocCs |jj}|jr| | ¡¡dSrh)rrÅr±rì)r@ÚctxÚinstrumenting_mapperrkrkrlr ýsr cCs(|jj}|r$| ¡|jr$| |¡dS)zÀRun init_instance hooks.
 
    This also includes mapper compilation, normally not needed
    here but helps with some piecemeal configuration
    scenarios (such as in the ORM tutorial).
 
    N)rrÅrjrÑ)r@ruÚkwargsrqrkrkrlrs
    rc@s$eZdZdZdZdd„Zdd„ZdS)rÏz4Error reporting helper for mapper._columntoproperty.r0cCs
||_dSrhr0rprkrkrlr½sz_ColumnMapping.__init__cCsH|jj |¡}|r0t d|jj|j|j|f¡‚t d||jf¡‚dS)NzDColumn '%s.%s' is not available, due to conflicting property '%s':%rz*No column %s is configured on mapper %s...)rÅrÎr<Úorm_excZUnmappedColumnErrorrÀrrø)r¼rñrùrkrkrlÚ __missing__sþÿÿÿz_ColumnMapping.__missing__N)ržrrQrRÚ    __slots__r½rtrkrkrkrlrÏsrÏ)rra)™rRÚ
__future__rÚ collectionsrÚ    functoolsrÚ    itertoolsrr]Ú    threadingÚtypingrrrr    r
r r r rrrrrrrrrrrrÚweakrefr5rrrsrrrr rÍÚ_typingr!r7r"r#r$r%r&Z
interfacesr'r(r)r*r+r,r-Z path_registryr.r0r¦r1r2r3r4r5r6r8r8r9r:r;r<râr=Z sql.cache_keyr>Z sql.elementsr?Z
sql.schemar@rAZsql.selectablerBrCrDZ util.typingrErFrGrHrIZdecl_apirJÚ
dependencyrKrTrLrMÚeventsrNrOrPrQr×rRr@rSrTZenginerUrVZ sql._typingrWrXZsql.baserYrZr[r\r]r^r`rbZ_WithPolymorphicArgÚWeakKeyDictionaryrerSrmrqrYÚsymbolrrÚRLockriZ_self_inspectsZ class_loggerZ
IdentifiedZ Inspectablersr\r#rWrirVrZrfrhror rrÏrkrkrkrlÚ<module>    sZ                                                                                                    ÿÿûÿ þ
 
 
øcG#5"ÿ/