aiteamutils 0.2.117__py3-none-any.whl → 0.2.118__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.
aiteamutils/validators.py
CHANGED
@@ -276,29 +276,15 @@ def _create_validator(field_names: tuple[str, ...],
|
|
276
276
|
return cls
|
277
277
|
return decorator
|
278
278
|
|
279
|
-
def date_validator(*
|
280
|
-
"""날짜
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
if isinstance(value, str):
|
289
|
-
datetime.strptime(value, "%Y-%m-%d")
|
290
|
-
elif isinstance(value, datetime):
|
291
|
-
return value.date()
|
292
|
-
return value
|
293
|
-
except ValueError:
|
294
|
-
raise CustomException(
|
295
|
-
ErrorCode.INVALID_DATE_FORMAT,
|
296
|
-
detail=f"{field}|{value}",
|
297
|
-
source_function="Validator.validate_date"
|
298
|
-
)
|
299
|
-
setattr(cls, f'validate_{field}', validate_date)
|
300
|
-
return cls
|
301
|
-
return decorator
|
279
|
+
def date_validator(*field_names: str):
|
280
|
+
"""날짜 필드 유효성 검사 데코레이터"""
|
281
|
+
return _create_validator(
|
282
|
+
field_names=field_names,
|
283
|
+
validate_func=Validator.validate_date,
|
284
|
+
field_type=date,
|
285
|
+
error_code=ErrorCode.VALIDATION_ERROR, # INVALID_DATE_FORMAT 대신 VALIDATION_ERROR 사용
|
286
|
+
source_prefix="date_validator"
|
287
|
+
)
|
302
288
|
|
303
289
|
def datetime_validator(*field_names: str):
|
304
290
|
"""날짜+시간 필드 유효성 검사 데코레이터"""
|
@@ -306,6 +292,6 @@ def datetime_validator(*field_names: str):
|
|
306
292
|
field_names=field_names,
|
307
293
|
validate_func=Validator.validate_datetime,
|
308
294
|
field_type=datetime,
|
309
|
-
error_code=ErrorCode.INVALID_DATETIME_FORMAT
|
295
|
+
error_code=ErrorCode.VALIDATION_ERROR, # INVALID_DATETIME_FORMAT 대신 VALIDATION_ERROR 사용
|
310
296
|
source_prefix="datetime_validator"
|
311
297
|
)
|
aiteamutils/version.py
CHANGED
@@ -1,2 +1,2 @@
|
|
1
1
|
"""버전 정보"""
|
2
|
-
__version__ = "0.2.
|
2
|
+
__version__ = "0.2.118"
|
@@ -8,8 +8,8 @@ aiteamutils/database.py,sha256=2D4YX8sfxZCvhKoqKSNbxyIZTb9Wc2-jsNBpLA7T7s0,19939
|
|
8
8
|
aiteamutils/enums.py,sha256=7WLqlcJqQWtETAga2WAxNp3dJTQIAd2TW-4WzkoHHa8,2498
|
9
9
|
aiteamutils/exceptions.py,sha256=zRwtEAhb6HcruZ2pFyraxdpo5YWtBTLPIWtz6lKUVU0,16287
|
10
10
|
aiteamutils/security.py,sha256=McUl3t5Z5SyUDVUHymHdDkYyF4YSeg4g9fFMML4W6Kw,11630
|
11
|
-
aiteamutils/validators.py,sha256=
|
12
|
-
aiteamutils/version.py,sha256
|
13
|
-
aiteamutils-0.2.
|
14
|
-
aiteamutils-0.2.
|
15
|
-
aiteamutils-0.2.
|
11
|
+
aiteamutils/validators.py,sha256=0TN8TTeWGrCTrLVamUFmEOx3RjzF3B8712ui9dkpL6I,12070
|
12
|
+
aiteamutils/version.py,sha256=-TGxcRBdq0SVKdAVmmJ0efQf2ke0CDo_QjyPJitgA_o,43
|
13
|
+
aiteamutils-0.2.118.dist-info/METADATA,sha256=KuxZvz7iJvYCsU1WCgSvtwrCJGfv1KHUh811jFNvBo8,1719
|
14
|
+
aiteamutils-0.2.118.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
15
|
+
aiteamutils-0.2.118.dist-info/RECORD,,
|
File without changes
|