arpakitlib 1.8.256__py3-none-any.whl → 1.8.258__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.
@@ -70,7 +70,7 @@ def _get_property_name_to_type_from_model_class(
70
70
  if property_name in exclude_property_names:
71
71
  continue
72
72
  if exclude_property_types:
73
- if not _type_matches(type_=ret_type, allowed_types=exclude_property_types):
73
+ if _type_matches(type_=ret_type, allowed_types=exclude_property_types):
74
74
  continue
75
75
  props[property_name] = ret_type
76
76
  return props
@@ -122,7 +122,8 @@ def pydantic_schema_from_sqlalchemy_model(
122
122
  exclude_property_types: list[type] | None = None,
123
123
  filter_property_prefixes: list[str] | None = None,
124
124
  remove_property_prefixes: list[str] | None = None,
125
- skip_property_if_cannot_define_type: bool = True
125
+ skip_property_if_cannot_define_type: bool = True,
126
+ skip_property_name_if_exists: bool = True
126
127
  ) -> type[BaseModel]:
127
128
  """
128
129
  Генерирует Pydantic-модель из колонок SQLAlchemy-модели и (опционально) из @property.
@@ -240,10 +241,11 @@ def pydantic_schema_from_sqlalchemy_model(
240
241
  ):
241
242
  renamed_property_name_to_type[new_property_name] = property_type
242
243
  else:
243
- raise ValueError(
244
- f"Property name '{property_name}' after removing prefix "
245
- f"conflicts with existing name '{new_property_name}'"
246
- )
244
+ if not skip_property_name_if_exists:
245
+ raise ValueError(
246
+ f"Property name '{property_name}' after removing prefix "
247
+ f"conflicts with existing name '{new_property_name}'"
248
+ )
247
249
  property_name_to_type.update(renamed_property_name_to_type)
248
250
 
249
251
  # добавляем (колонки в приоритете)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: arpakitlib
3
- Version: 1.8.256
3
+ Version: 1.8.258
4
4
  Summary: arpakitlib
5
5
  License: Apache-2.0
6
6
  Keywords: arpakitlib,arpakit,arpakit-company,arpakitcompany,arpakit_company
@@ -414,7 +414,7 @@ arpakitlib/ar_need_type_util.py,sha256=XmY1kswz8j9oo5f9CxRu0_zgfvxWrXPYKOj6MM04s
414
414
  arpakitlib/ar_openai_api_client_util.py,sha256=dWgsSPXtxNBxS5VRi_NharGQrUXF_YjIfhU3Bj5cW9M,5651
415
415
  arpakitlib/ar_parse_command.py,sha256=1WTdQoWVshoDZ1jDaKeTzajfqaYHP3FNO0-REyo1aMY,3003
416
416
  arpakitlib/ar_postgresql_util.py,sha256=1AuLjEaa1Lg4pzn-ukCVnDi35Eg1k91APRTqZhIJAdo,945
417
- arpakitlib/ar_pydantic_schema_from_sqlalchemy_model.py,sha256=qk439Ii9WFo8vqESt6w93HkRe5XvjOiy-PGa0wXazVg,10677
417
+ arpakitlib/ar_pydantic_schema_from_sqlalchemy_model.py,sha256=yOIgvrFeRm_MUwK7dc1sA_DD5yTKKAFb2HxF4zyGof8,10801
418
418
  arpakitlib/ar_raise_own_exception_if_exception.py,sha256=A6TuNSBk1pHaQ_qxnUmE2LgsNGA1IGqX26b1_HEA4Nc,5978
419
419
  arpakitlib/ar_rat_func_util.py,sha256=Ca10o3RJwyx_DJLxjTxgHDO6NU3M6CWgUR4bif67OE4,2006
420
420
  arpakitlib/ar_really_validate_email.py,sha256=HBfhyiDB3INI6Iq6hR2WOMKA5wVWWRl0Qun-x__OZ9o,1201
@@ -430,8 +430,8 @@ arpakitlib/ar_sqlalchemy_util.py,sha256=FDva9onjtCPrYZYIHHb93NMwD1WlmaORjiWgPRJQ
430
430
  arpakitlib/ar_str_util.py,sha256=2lGpnXDf2h1cBZpVf5i1tX_HCv5iBd6IGnrCw4QWWlY,4350
431
431
  arpakitlib/ar_type_util.py,sha256=Cs_tef-Fc5xeyAF54KgISCsP11NHyzIsglm4S3Xx7iM,4049
432
432
  arpakitlib/ar_yookassa_api_client_util.py,sha256=VozuZeCJjmLd1zj2BdC9WfiAQ3XYOrIMsdpNK-AUlm0,5347
433
- arpakitlib-1.8.256.dist-info/LICENSE,sha256=GPEDQMam2r7FSTYqM1mm7aKnxLaWcBotH7UvQtea-ec,11355
434
- arpakitlib-1.8.256.dist-info/METADATA,sha256=9PSap0kkeDfMLn2Zv9uffEhxTtP5Y68sT5-eoerWx7M,3919
435
- arpakitlib-1.8.256.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
436
- arpakitlib-1.8.256.dist-info/entry_points.txt,sha256=36xqR3PJFT2kuwjkM_EqoIy0qFUDPKSm_mJaI7emewE,87
437
- arpakitlib-1.8.256.dist-info/RECORD,,
433
+ arpakitlib-1.8.258.dist-info/LICENSE,sha256=GPEDQMam2r7FSTYqM1mm7aKnxLaWcBotH7UvQtea-ec,11355
434
+ arpakitlib-1.8.258.dist-info/METADATA,sha256=TmbE6VOMn-T80eJUfQdCRpVbrurBEodE_x1U_o_UDWU,3919
435
+ arpakitlib-1.8.258.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
436
+ arpakitlib-1.8.258.dist-info/entry_points.txt,sha256=36xqR3PJFT2kuwjkM_EqoIy0qFUDPKSm_mJaI7emewE,87
437
+ arpakitlib-1.8.258.dist-info/RECORD,,