mirror of
https://gitlab.com/MoonTestUse1/AdministrationItDepartmens.git
synced 2025-08-14 00:25:46 +02:00
Проверка 09.02.2025
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import math
|
||||
import typing
|
||||
import uuid
|
||||
@@ -65,7 +67,7 @@ class FloatConvertor(Convertor[float]):
|
||||
|
||||
|
||||
class UUIDConvertor(Convertor[uuid.UUID]):
|
||||
regex = "[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}"
|
||||
regex = "[0-9a-fA-F]{8}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{12}"
|
||||
|
||||
def convert(self, value: str) -> uuid.UUID:
|
||||
return uuid.UUID(value)
|
||||
@@ -74,7 +76,7 @@ class UUIDConvertor(Convertor[uuid.UUID]):
|
||||
return str(value)
|
||||
|
||||
|
||||
CONVERTOR_TYPES: typing.Dict[str, Convertor[typing.Any]] = {
|
||||
CONVERTOR_TYPES: dict[str, Convertor[typing.Any]] = {
|
||||
"str": StringConvertor(),
|
||||
"path": PathConvertor(),
|
||||
"int": IntegerConvertor(),
|
||||
|
Reference in New Issue
Block a user