Init project

This commit is contained in:
2026-01-15 09:47:43 +03:00
commit 3e515c66ec
59 changed files with 5101 additions and 0 deletions

View File

@@ -0,0 +1,20 @@
from typing import Any
from sqlmodel import SQLModel
class RepositoryException(Exception):
pass
class HaveNoSessionError(RepositoryException):
def __init__(self):
super().__init__("Have no actual session")
class AlreadyExistsError(RepositoryException):
def __init__(self, model: SQLModel, values: dict[str, Any]):
super().__init__(f"Record for model '{model.__name__}' already exists")
self.model = model
self.values = values