arpakitlib 1.8.220__py3-none-any.whl → 1.8.221__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- arpakitlib/ar_sqlalchemy_util.py +26 -4
- {arpakitlib-1.8.220.dist-info → arpakitlib-1.8.221.dist-info}/METADATA +1 -1
- {arpakitlib-1.8.220.dist-info → arpakitlib-1.8.221.dist-info}/RECORD +6 -6
- {arpakitlib-1.8.220.dist-info → arpakitlib-1.8.221.dist-info}/LICENSE +0 -0
- {arpakitlib-1.8.220.dist-info → arpakitlib-1.8.221.dist-info}/WHEEL +0 -0
- {arpakitlib-1.8.220.dist-info → arpakitlib-1.8.221.dist-info}/entry_points.txt +0 -0
arpakitlib/ar_sqlalchemy_util.py
CHANGED
@@ -89,32 +89,54 @@ class BaseDBM(DeclarativeBase):
|
|
89
89
|
def get_relationship_names_(
|
90
90
|
cls,
|
91
91
|
*,
|
92
|
+
exclude_one_to_many: bool = False,
|
93
|
+
exclude_many_to_one: bool = False,
|
94
|
+
exclude_many_to_many: bool = False,
|
95
|
+
exclude_viewonly: bool = False,
|
92
96
|
exclude_names: list[str] | None = None
|
93
97
|
) -> list[str]:
|
94
98
|
if exclude_names is None:
|
95
99
|
exclude_names = []
|
96
100
|
res = []
|
97
|
-
for
|
98
|
-
if
|
101
|
+
for r in inspect(cls).relationships:
|
102
|
+
if r.key in exclude_names:
|
99
103
|
continue
|
100
|
-
|
104
|
+
if exclude_viewonly and r.viewonly:
|
105
|
+
continue
|
106
|
+
if exclude_one_to_many and r.direction is sqlalchemy.orm.ONETOMANY:
|
107
|
+
continue
|
108
|
+
if exclude_many_to_one and r.direction is sqlalchemy.orm.MANYTOONE:
|
109
|
+
continue
|
110
|
+
if exclude_many_to_many and r.direction is sqlalchemy.orm.MANYTOMANY:
|
111
|
+
continue
|
112
|
+
res.append(r.key)
|
101
113
|
return res
|
102
114
|
|
103
115
|
@classmethod
|
104
116
|
def get_column_and_relationship_names_(
|
105
117
|
cls,
|
106
118
|
*,
|
119
|
+
|
107
120
|
include_column_names: bool = True,
|
108
121
|
include_column_pk: bool = True,
|
109
122
|
exclude_column_names: list[str] | None = None,
|
123
|
+
|
110
124
|
include_relationship_names: bool = True,
|
125
|
+
exclude_one_to_many: bool = False,
|
126
|
+
exclude_many_to_one: bool = False,
|
127
|
+
exclude_many_to_many: bool = False,
|
111
128
|
exclude_relationship_names: list[str] | None = None,
|
112
129
|
) -> list[str]:
|
113
130
|
res = []
|
114
131
|
if include_column_names:
|
115
132
|
res += cls.get_column_names_(include_pk=include_column_pk, exclude_names=exclude_column_names)
|
116
133
|
if include_relationship_names:
|
117
|
-
res += cls.get_relationship_names_(
|
134
|
+
res += cls.get_relationship_names_(
|
135
|
+
exclude_names=exclude_relationship_names,
|
136
|
+
exclude_one_to_many=exclude_one_to_many,
|
137
|
+
exclude_many_to_one=exclude_many_to_one,
|
138
|
+
exclude_many_to_many=exclude_many_to_many,
|
139
|
+
)
|
118
140
|
return res
|
119
141
|
|
120
142
|
@classmethod
|
@@ -411,14 +411,14 @@ arpakitlib/ar_schedule_uust_api_client_util.py,sha256=rXI2_3OTaIBgR-GixM1Ti-Ue1f
|
|
411
411
|
arpakitlib/ar_settings_util.py,sha256=Y5wi_cmsjDjfJpM0VJHjbo0NoVPKfypKaD1USowwDtQ,1327
|
412
412
|
arpakitlib/ar_sleep_util.py,sha256=ggaj7ML6QK_ADsHMcyu6GUmUpQ_9B9n-SKYH17h-9lM,1045
|
413
413
|
arpakitlib/ar_sqladmin_util.py,sha256=SEoaowAPF3lhxPsNjwmOymNJ55Ty9rmzvsDm7gD5Ceo,861
|
414
|
-
arpakitlib/ar_sqlalchemy_util.py,sha256=
|
414
|
+
arpakitlib/ar_sqlalchemy_util.py,sha256=Ia8eR-XiB9nZWwknLqqySS5L4RlKFe1bkTZ15rpLD8U,15270
|
415
415
|
arpakitlib/ar_str_util.py,sha256=2lGpnXDf2h1cBZpVf5i1tX_HCv5iBd6IGnrCw4QWWlY,4350
|
416
416
|
arpakitlib/ar_type_util.py,sha256=Cs_tef-Fc5xeyAF54KgISCsP11NHyzIsglm4S3Xx7iM,4049
|
417
417
|
arpakitlib/ar_yookassa_api_client_util.py,sha256=VozuZeCJjmLd1zj2BdC9WfiAQ3XYOrIMsdpNK-AUlm0,5347
|
418
418
|
arpakitlib/clone_pydantic_model_fields.py,sha256=Gn9_AIjKknN1eIYK_xH_cMyff3hjOpfwRqs583-rnJs,1167
|
419
419
|
arpakitlib/pydantic_schema_from_sqlalchemy_model.py,sha256=bjLNfeJRZonvVl7pnczwL8OzxbIGawulp30K-xYY7yA,2833
|
420
|
-
arpakitlib-1.8.
|
421
|
-
arpakitlib-1.8.
|
422
|
-
arpakitlib-1.8.
|
423
|
-
arpakitlib-1.8.
|
424
|
-
arpakitlib-1.8.
|
420
|
+
arpakitlib-1.8.221.dist-info/LICENSE,sha256=GPEDQMam2r7FSTYqM1mm7aKnxLaWcBotH7UvQtea-ec,11355
|
421
|
+
arpakitlib-1.8.221.dist-info/METADATA,sha256=-RqKllIWyEjPQbbvpX2G9z6OpQwHUf15Ztn1MNOKnRw,3741
|
422
|
+
arpakitlib-1.8.221.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
|
423
|
+
arpakitlib-1.8.221.dist-info/entry_points.txt,sha256=36xqR3PJFT2kuwjkM_EqoIy0qFUDPKSm_mJaI7emewE,87
|
424
|
+
arpakitlib-1.8.221.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|