aiteamutils 0.2.60__tar.gz → 0.2.62__tar.gz
Sign up to get free protection for your applications and to get access to all the features.
- {aiteamutils-0.2.60 → aiteamutils-0.2.62}/PKG-INFO +1 -1
- {aiteamutils-0.2.60 → aiteamutils-0.2.62}/aiteamutils/__init__.py +0 -4
- {aiteamutils-0.2.60 → aiteamutils-0.2.62}/aiteamutils/base_repository.py +12 -2
- {aiteamutils-0.2.60 → aiteamutils-0.2.62}/aiteamutils/validators.py +0 -1
- aiteamutils-0.2.62/aiteamutils/version.py +2 -0
- aiteamutils-0.2.60/aiteamutils/version.py +0 -2
- {aiteamutils-0.2.60 → aiteamutils-0.2.62}/.cursorrules +0 -0
- {aiteamutils-0.2.60 → aiteamutils-0.2.62}/.gitignore +0 -0
- {aiteamutils-0.2.60 → aiteamutils-0.2.62}/README.md +0 -0
- {aiteamutils-0.2.60 → aiteamutils-0.2.62}/aiteamutils/base_model.py +0 -0
- {aiteamutils-0.2.60 → aiteamutils-0.2.62}/aiteamutils/base_service.py +0 -0
- {aiteamutils-0.2.60 → aiteamutils-0.2.62}/aiteamutils/cache.py +0 -0
- {aiteamutils-0.2.60 → aiteamutils-0.2.62}/aiteamutils/config.py +0 -0
- {aiteamutils-0.2.60 → aiteamutils-0.2.62}/aiteamutils/database.py +0 -0
- {aiteamutils-0.2.60 → aiteamutils-0.2.62}/aiteamutils/enums.py +0 -0
- {aiteamutils-0.2.60 → aiteamutils-0.2.62}/aiteamutils/exceptions.py +0 -0
- {aiteamutils-0.2.60 → aiteamutils-0.2.62}/aiteamutils/security.py +0 -0
- {aiteamutils-0.2.60 → aiteamutils-0.2.62}/pyproject.toml +0 -0
- {aiteamutils-0.2.60 → aiteamutils-0.2.62}/setup.py +0 -0
@@ -1,5 +1,4 @@
|
|
1
1
|
from .base_model import Base
|
2
|
-
from .database import DatabaseService
|
3
2
|
from .exceptions import (
|
4
3
|
CustomException,
|
5
4
|
ErrorCode,
|
@@ -28,9 +27,6 @@ __all__ = [
|
|
28
27
|
"BaseService",
|
29
28
|
"BaseRepository",
|
30
29
|
|
31
|
-
# Database
|
32
|
-
"DatabaseService",
|
33
|
-
|
34
30
|
# Exceptions
|
35
31
|
"CustomException",
|
36
32
|
"ErrorCode",
|
@@ -26,13 +26,23 @@ class BaseRepository(Generic[ModelType]):
|
|
26
26
|
source_function=f"{self.__class__.__name__}.model"
|
27
27
|
)
|
28
28
|
|
29
|
-
self.
|
29
|
+
self._session = session
|
30
30
|
self.model = model
|
31
31
|
|
32
32
|
@property
|
33
33
|
def session(self) -> AsyncSession:
|
34
34
|
return self._session
|
35
35
|
|
36
|
+
@session.setter
|
37
|
+
def session(self, value: AsyncSession):
|
38
|
+
if value is None:
|
39
|
+
raise CustomException(
|
40
|
+
ErrorCode.DB_CONNECTION_ERROR,
|
41
|
+
detail="Session cannot be None",
|
42
|
+
source_function=f"{self.__class__.__name__}.session"
|
43
|
+
)
|
44
|
+
self._session = value
|
45
|
+
|
36
46
|
async def list(
|
37
47
|
self,
|
38
48
|
skip: int = 0,
|
@@ -45,7 +55,7 @@ class BaseRepository(Generic[ModelType]):
|
|
45
55
|
"""
|
46
56
|
# 기본 CRUD 작업 호출
|
47
57
|
return await list_entities(
|
48
|
-
session=self.
|
58
|
+
session=self.session,
|
49
59
|
model=self.model,
|
50
60
|
skip=skip,
|
51
61
|
limit=limit,
|
@@ -10,7 +10,6 @@ from pydantic import BaseModel, field_validator
|
|
10
10
|
import re
|
11
11
|
|
12
12
|
from .exceptions import ErrorCode, CustomException
|
13
|
-
from .database import DatabaseService
|
14
13
|
from .base_model import Base
|
15
14
|
|
16
15
|
def validate_with(validator_func, unique_check=None, skip_if_none=False):
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|