aiteamutils 0.2.62__tar.gz → 0.2.64__tar.gz
Sign up to get free protection for your applications and to get access to all the features.
- {aiteamutils-0.2.62 → aiteamutils-0.2.64}/PKG-INFO +1 -1
- {aiteamutils-0.2.62 → aiteamutils-0.2.64}/aiteamutils/base_repository.py +3 -0
- {aiteamutils-0.2.62 → aiteamutils-0.2.64}/aiteamutils/base_service.py +17 -0
- aiteamutils-0.2.64/aiteamutils/version.py +2 -0
- aiteamutils-0.2.62/aiteamutils/version.py +0 -2
- {aiteamutils-0.2.62 → aiteamutils-0.2.64}/.cursorrules +0 -0
- {aiteamutils-0.2.62 → aiteamutils-0.2.64}/.gitignore +0 -0
- {aiteamutils-0.2.62 → aiteamutils-0.2.64}/README.md +0 -0
- {aiteamutils-0.2.62 → aiteamutils-0.2.64}/aiteamutils/__init__.py +0 -0
- {aiteamutils-0.2.62 → aiteamutils-0.2.64}/aiteamutils/base_model.py +0 -0
- {aiteamutils-0.2.62 → aiteamutils-0.2.64}/aiteamutils/cache.py +0 -0
- {aiteamutils-0.2.62 → aiteamutils-0.2.64}/aiteamutils/config.py +0 -0
- {aiteamutils-0.2.62 → aiteamutils-0.2.64}/aiteamutils/database.py +0 -0
- {aiteamutils-0.2.62 → aiteamutils-0.2.64}/aiteamutils/enums.py +0 -0
- {aiteamutils-0.2.62 → aiteamutils-0.2.64}/aiteamutils/exceptions.py +0 -0
- {aiteamutils-0.2.62 → aiteamutils-0.2.64}/aiteamutils/security.py +0 -0
- {aiteamutils-0.2.62 → aiteamutils-0.2.64}/aiteamutils/validators.py +0 -0
- {aiteamutils-0.2.62 → aiteamutils-0.2.64}/pyproject.toml +0 -0
- {aiteamutils-0.2.62 → aiteamutils-0.2.64}/setup.py +0 -0
@@ -25,9 +25,12 @@ class BaseRepository(Generic[ModelType]):
|
|
25
25
|
detail="Model is not set",
|
26
26
|
source_function=f"{self.__class__.__name__}.model"
|
27
27
|
)
|
28
|
+
print(f"BaseRepository.__init__() called with session: {session} and model: {model}")
|
28
29
|
|
29
30
|
self._session = session
|
30
31
|
self.model = model
|
32
|
+
|
33
|
+
print(f"BaseRepository initialized with session: {session} and model: {model}")
|
31
34
|
|
32
35
|
@property
|
33
36
|
def session(self) -> AsyncSession:
|
@@ -20,10 +20,27 @@ class BaseService(Generic[ModelType]):
|
|
20
20
|
repository: BaseRepository[ModelType],
|
21
21
|
db_session: AsyncSession
|
22
22
|
):
|
23
|
+
if not repository:
|
24
|
+
raise CustomException(
|
25
|
+
ErrorCode.INVALID_REQUEST,
|
26
|
+
detail="Repository is not set",
|
27
|
+
source_function=f"{self.__class__.__name__}.__init__"
|
28
|
+
)
|
29
|
+
if not db_session:
|
30
|
+
raise CustomException(
|
31
|
+
ErrorCode.INVALID_REQUEST,
|
32
|
+
detail="Database session is not set",
|
33
|
+
source_function=f"{self.__class__.__name__}.__init__"
|
34
|
+
)
|
35
|
+
print(f"BaseService.__init__() called with repository: {repository} and db_session: {db_session}")
|
36
|
+
|
37
|
+
|
23
38
|
self.model = model
|
24
39
|
self.repository = repository
|
25
40
|
self.db_session = db_session
|
26
41
|
|
42
|
+
print(f"BaseService initialized with repository: {repository} and db_session: {db_session}")
|
43
|
+
|
27
44
|
async def list(
|
28
45
|
self,
|
29
46
|
skip: int = 0,
|
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
|
File without changes
|