diff --git a/ApiValidations/Custom/__init__.py b/ApiValidations/Custom/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/ApiValidations/Response/__init__.py b/ApiValidations/Response/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/ErrorHandlers/ApiErrorHandlers/__init__.py b/ErrorHandlers/ApiErrorHandlers/__init__.py deleted file mode 100644 index 8b3aa1e..0000000 --- a/ErrorHandlers/ApiErrorHandlers/__init__.py +++ /dev/null @@ -1,10 +0,0 @@ -from ErrorHandlers.ApiErrorHandlers.api_exc_handler import ( - HTTPExceptionApiHandler, - HTTPExceptionApi, -) - - -__all__ = [ - "HTTPExceptionApiHandler", - "HTTPExceptionApi", -] diff --git a/ErrorHandlers/ApiErrorHandlers/api_exc_handler.py b/ErrorHandlers/ErrorHandlers/api_exc_handler.py similarity index 88% rename from ErrorHandlers/ApiErrorHandlers/api_exc_handler.py rename to ErrorHandlers/ErrorHandlers/api_exc_handler.py index 6d65cf5..a737fd9 100644 --- a/ErrorHandlers/ApiErrorHandlers/api_exc_handler.py +++ b/ErrorHandlers/ErrorHandlers/api_exc_handler.py @@ -1,11 +1,5 @@ -from typing import Any, Dict, List, Optional - - -class HTTPExceptionApi(Exception): - - def __init__(self, error_code: str, lang: str): - self.error_code = error_code - self.lang = lang +from typing import Any, Dict +from ErrorHandlers.Exceptions.api_exc import HTTPExceptionApi class HTTPExceptionApiHandler: diff --git a/ErrorHandlers/Exceptions/api_exc.py b/ErrorHandlers/Exceptions/api_exc.py new file mode 100644 index 0000000..251e1e2 --- /dev/null +++ b/ErrorHandlers/Exceptions/api_exc.py @@ -0,0 +1,7 @@ + + +class HTTPExceptionApi(Exception): + + def __init__(self, error_code: str, lang: str): + self.error_code = error_code + self.lang = lang diff --git a/ErrorHandlers/__init__.py b/ErrorHandlers/__init__.py index e69de29..cecfe13 100644 --- a/ErrorHandlers/__init__.py +++ b/ErrorHandlers/__init__.py @@ -0,0 +1,12 @@ +from ErrorHandlers.ErrorHandlers.api_exc_handler import ( + HTTPExceptionApiHandler, +) +from ErrorHandlers.Exceptions.api_exc import ( + HTTPExceptionApi, +) + + +__all__ = [ + "HTTPExceptionApiHandler", + "HTTPExceptionApi", +] diff --git a/Services/PostgresDb/Models/alchemy_response.py b/Services/PostgresDb/Models/alchemy_response.py index 54b767c..9fe2640 100644 --- a/Services/PostgresDb/Models/alchemy_response.py +++ b/Services/PostgresDb/Models/alchemy_response.py @@ -21,8 +21,8 @@ from sqlalchemy.orm import Query from ApiValidations.Request.base_validations import PydanticBaseModel from ApiValidations.handler import BaseModelRegular -from Services.Postgres.Models.response import PostgresResponse -from ErrorHandlers.ApiErrorHandlers.api_exc_handler import HTTPExceptionApi +from Services.PostgresDb.Models.response import PostgresResponse +from ErrorHandlers.ErrorHandlers.api_exc_handler import HTTPExceptionApi T = TypeVar("T") diff --git a/Services/PostgresDb/Models/base_model.py b/Services/PostgresDb/Models/base_model.py index 6d5abf1..b5f5558 100644 --- a/Services/PostgresDb/Models/base_model.py +++ b/Services/PostgresDb/Models/base_model.py @@ -1,6 +1,5 @@ from contextlib import contextmanager from typing import Any, Dict, Optional, Generator -from fastapi import HTTPException, status from sqlalchemy.orm import Session diff --git a/Services/PostgresDb/Models/filter_functions.py b/Services/PostgresDb/Models/filter_functions.py index 57d78ca..898a512 100644 --- a/Services/PostgresDb/Models/filter_functions.py +++ b/Services/PostgresDb/Models/filter_functions.py @@ -16,7 +16,7 @@ from sqlalchemy.orm import Query, Session from sqlalchemy.sql.elements import BinaryExpression from ApiLibrary import system_arrow -from ErrorHandlers.ApiErrorHandlers import HTTPExceptionApi +from ErrorHandlers.Exceptions.api_exc import HTTPExceptionApi from Services.PostgresDb.Models.response import PostgresResponse # Type variable for class methods returning self diff --git a/Services/PostgresDb/Models/how_to.py b/Services/PostgresDb/Models/how_to.py index fa8287a..746dfa6 100644 --- a/Services/PostgresDb/Models/how_to.py +++ b/Services/PostgresDb/Models/how_to.py @@ -10,8 +10,8 @@ from typing import Optional, List from sqlalchemy import String, Integer from sqlalchemy.orm import Mapped, mapped_column -from Services.Postgres.Models.my_base_model import CrudCollection -from Services.Postgres.database import get_db +from Services.PostgresDb import CrudCollection +from Services.PostgresDb.database import get_db # Example Model Definition diff --git a/Services/PostgresDb/Models/mixins.py b/Services/PostgresDb/Models/mixins.py index d206dbc..83ba31d 100644 --- a/Services/PostgresDb/Models/mixins.py +++ b/Services/PostgresDb/Models/mixins.py @@ -31,7 +31,7 @@ from sqlalchemy_mixins.repr import ReprMixin from sqlalchemy_mixins.smartquery import SmartQueryMixin from ApiLibrary import DateTimeLocal, system_arrow -from Services.Postgres.database import Base +from Services.PostgresDb.database import Base from Services.PostgresDb.Models.filter_functions import FilterAttributes # Type variable for class methods returning self diff --git a/Services/Redis/Models/row.py b/Services/Redis/Models/row.py index 189dae1..9aad9a1 100644 --- a/Services/Redis/Models/row.py +++ b/Services/Redis/Models/row.py @@ -17,9 +17,3 @@ class AccessToken(BaseModel): def delimiter(self): return "*" - -# access_token_obj = AccessToken.from_dict({ -# "accessToken": "token", -# "userUUID": "uuid" -# }) -# access_token_obj.to_list()