chore: restructured project

This commit is contained in:
ITQ
2025-03-07 19:32:09 +03:00
parent bfb7ad901a
commit 0a35951c62
178 changed files with 304 additions and 376 deletions
+21
View File
@@ -0,0 +1,21 @@
from django.core.cache import cache
from ninja import Schema
from pydantic import field_validator
from pydantic.types import NonNegativeInt
class CurrentDate(Schema):
current_date: NonNegativeInt
@field_validator("current_date", mode="after")
@classmethod
def check_bigger_than_setted_date(cls, value: int) -> int:
current_date = cache.get("current_date", default=0)
if value < current_date:
err = (
"current_date can't be less than setted "
f"date ({current_date})."
)
raise ValueError(err)
return value