python-general-be-lib 0.5.1__tar.gz → 0.5.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {python_general_be_lib-0.5.1 → python_general_be_lib-0.5.2}/PKG-INFO +1 -1
- {python_general_be_lib-0.5.1 → python_general_be_lib-0.5.2}/general/interface/repository/handler/interval_handler.py +9 -4
- {python_general_be_lib-0.5.1 → python_general_be_lib-0.5.2}/pyproject.toml +1 -1
- {python_general_be_lib-0.5.1 → python_general_be_lib-0.5.2}/python_general_be_lib.egg-info/PKG-INFO +1 -1
- {python_general_be_lib-0.5.1 → python_general_be_lib-0.5.2}/setup.py +1 -1
- {python_general_be_lib-0.5.1 → python_general_be_lib-0.5.2}/LICENSE +0 -0
- {python_general_be_lib-0.5.1 → python_general_be_lib-0.5.2}/README.md +0 -0
- {python_general_be_lib-0.5.1 → python_general_be_lib-0.5.2}/general/__init__.py +0 -0
- {python_general_be_lib-0.5.1 → python_general_be_lib-0.5.2}/general/exception/__init__.py +0 -0
- {python_general_be_lib-0.5.1 → python_general_be_lib-0.5.2}/general/exception/access_exceptions.py +0 -0
- {python_general_be_lib-0.5.1 → python_general_be_lib-0.5.2}/general/exception/crud_exceptions.py +0 -0
- {python_general_be_lib-0.5.1 → python_general_be_lib-0.5.2}/general/exception/exception_interface.py +0 -0
- {python_general_be_lib-0.5.1 → python_general_be_lib-0.5.2}/general/interface/base/__init__.py +0 -0
- {python_general_be_lib-0.5.1 → python_general_be_lib-0.5.2}/general/interface/base/base_model.py +0 -0
- {python_general_be_lib-0.5.1 → python_general_be_lib-0.5.2}/general/interface/base/declarative_base.py +0 -0
- {python_general_be_lib-0.5.1 → python_general_be_lib-0.5.2}/general/interface/metadata/__init__.py +0 -0
- {python_general_be_lib-0.5.1 → python_general_be_lib-0.5.2}/general/interface/metadata/crud_metadata.py +0 -0
- {python_general_be_lib-0.5.1 → python_general_be_lib-0.5.2}/general/interface/metadata/geom_metadata.py +0 -0
- {python_general_be_lib-0.5.1 → python_general_be_lib-0.5.2}/general/interface/repository/__init__.py +0 -0
- {python_general_be_lib-0.5.1 → python_general_be_lib-0.5.2}/general/interface/repository/crud_repository.py +0 -0
- {python_general_be_lib-0.5.1 → python_general_be_lib-0.5.2}/general/interface/repository/geometry_repository.py +0 -0
- {python_general_be_lib-0.5.1 → python_general_be_lib-0.5.2}/general/interface/repository/handler/__init__.py +0 -0
- {python_general_be_lib-0.5.1 → python_general_be_lib-0.5.2}/general/interface/repository/handler/base_handler.py +0 -0
- {python_general_be_lib-0.5.1 → python_general_be_lib-0.5.2}/general/interface/repository/handler/ilike_handler.py +0 -0
- {python_general_be_lib-0.5.1 → python_general_be_lib-0.5.2}/general/interface/repository/handler/json_handler.py +0 -0
- {python_general_be_lib-0.5.1 → python_general_be_lib-0.5.2}/general/interface/repository/handler/statement_manager.py +0 -0
- {python_general_be_lib-0.5.1 → python_general_be_lib-0.5.2}/general/interface/repository/many_to_many_repository.py +0 -0
- {python_general_be_lib-0.5.1 → python_general_be_lib-0.5.2}/general/interface/repository/view_repository.py +0 -0
- {python_general_be_lib-0.5.1 → python_general_be_lib-0.5.2}/general/logger.py +0 -0
- {python_general_be_lib-0.5.1 → python_general_be_lib-0.5.2}/general/paginator_dto.py +0 -0
- {python_general_be_lib-0.5.1 → python_general_be_lib-0.5.2}/python_general_be_lib.egg-info/SOURCES.txt +0 -0
- {python_general_be_lib-0.5.1 → python_general_be_lib-0.5.2}/python_general_be_lib.egg-info/dependency_links.txt +0 -0
- {python_general_be_lib-0.5.1 → python_general_be_lib-0.5.2}/python_general_be_lib.egg-info/requires.txt +0 -0
- {python_general_be_lib-0.5.1 → python_general_be_lib-0.5.2}/python_general_be_lib.egg-info/top_level.txt +0 -0
- {python_general_be_lib-0.5.1 → python_general_be_lib-0.5.2}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: python-general-be-lib
|
|
3
|
-
Version: 0.5.
|
|
3
|
+
Version: 0.5.2
|
|
4
4
|
Summary: General purpose backend library — SQLAlchemy CRUD/Geometry repositories, FastAPI exceptions, Pydantic base models, logger utilities.
|
|
5
5
|
Author-email: Andrea Di Placido <a.diplacido@arpes.it>, "Arpes S.r.l." <it.admin@arpes.it>
|
|
6
6
|
License: MIT
|
|
@@ -31,12 +31,14 @@ class IntervalHandler(BaseHandler):
|
|
|
31
31
|
>>> repo.find(where={"start_date": "2024-01-01", "end_date": "2024-12-31"})
|
|
32
32
|
# WHERE start_date >= '2024-01-01' AND (end_date <= '2024-12-31' OR end_date IS NULL)
|
|
33
33
|
"""
|
|
34
|
-
__slots__ = "from_", "to_", "inf_is_none"
|
|
34
|
+
__slots__ = "from_", "to_", "inf_is_none", "from_alias", "to_alias", "between"
|
|
35
35
|
from_: Any
|
|
36
36
|
to_: Any
|
|
37
|
+
from_alias: str
|
|
38
|
+
to_alias: str
|
|
37
39
|
inf_is_none: bool
|
|
38
40
|
|
|
39
|
-
def __init__(self, columns: ReadOnlyColumnCollection[str, Column[Any]], from_: Any = None, to_: Any = None, inf_is_none: bool = False):
|
|
41
|
+
def __init__(self, columns: ReadOnlyColumnCollection[str, Column[Any]], from_: Any = None, from_alias: str = None, to_: Any = None, to_alias: str = None, inf_is_none: bool = False):
|
|
40
42
|
"""Inizializza l'handler con le chiavi per il limite inferiore e superiore.
|
|
41
43
|
|
|
42
44
|
Args:
|
|
@@ -52,7 +54,10 @@ class IntervalHandler(BaseHandler):
|
|
|
52
54
|
self.columns = columns
|
|
53
55
|
self.from_ = from_
|
|
54
56
|
self.to_ = to_
|
|
57
|
+
self.from_alias = from_alias if from_alias else str(from_)
|
|
58
|
+
self.to_alias = to_alias if to_alias else str(to_)
|
|
55
59
|
self.inf_is_none = inf_is_none
|
|
60
|
+
self.between = True if self.from_alias == self.to_alias else False
|
|
56
61
|
|
|
57
62
|
def handle(self, stmt: Select | Update | Delete, where: dict[str, Any] = None, **kwargs):
|
|
58
63
|
"""Applica le condizioni di range allo statement estraendo i valori da ``where``.
|
|
@@ -75,8 +80,8 @@ class IntervalHandler(BaseHandler):
|
|
|
75
80
|
- Limite superiore: ``col <= value`` oppure ``(col <= value OR col IS NULL)``
|
|
76
81
|
se ``inf_is_none=True``.
|
|
77
82
|
"""
|
|
78
|
-
from_condition = where.pop(self.
|
|
79
|
-
to_condition = where.pop(self.
|
|
83
|
+
from_condition = where.pop(self.from_alias, None)
|
|
84
|
+
to_condition = where.pop(self.to_alias, None) if not self.between else from_condition
|
|
80
85
|
if from_condition:
|
|
81
86
|
stmt = stmt.where(self.columns[self.from_] >= from_condition)
|
|
82
87
|
if to_condition:
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.backends.legacy:build"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "python-general-be-lib"
|
|
7
|
-
version = "0.5.
|
|
7
|
+
version = "0.5.2"
|
|
8
8
|
description = "General purpose backend library — SQLAlchemy CRUD/Geometry repositories, FastAPI exceptions, Pydantic base models, logger utilities."
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
license = { text = "MIT" }
|
{python_general_be_lib-0.5.1 → python_general_be_lib-0.5.2}/python_general_be_lib.egg-info/PKG-INFO
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: python-general-be-lib
|
|
3
|
-
Version: 0.5.
|
|
3
|
+
Version: 0.5.2
|
|
4
4
|
Summary: General purpose backend library — SQLAlchemy CRUD/Geometry repositories, FastAPI exceptions, Pydantic base models, logger utilities.
|
|
5
5
|
Author-email: Andrea Di Placido <a.diplacido@arpes.it>, "Arpes S.r.l." <it.admin@arpes.it>
|
|
6
6
|
License: MIT
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{python_general_be_lib-0.5.1 → python_general_be_lib-0.5.2}/general/exception/access_exceptions.py
RENAMED
|
File without changes
|
{python_general_be_lib-0.5.1 → python_general_be_lib-0.5.2}/general/exception/crud_exceptions.py
RENAMED
|
File without changes
|
{python_general_be_lib-0.5.1 → python_general_be_lib-0.5.2}/general/exception/exception_interface.py
RENAMED
|
File without changes
|
{python_general_be_lib-0.5.1 → python_general_be_lib-0.5.2}/general/interface/base/__init__.py
RENAMED
|
File without changes
|
{python_general_be_lib-0.5.1 → python_general_be_lib-0.5.2}/general/interface/base/base_model.py
RENAMED
|
File without changes
|
|
File without changes
|
{python_general_be_lib-0.5.1 → python_general_be_lib-0.5.2}/general/interface/metadata/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{python_general_be_lib-0.5.1 → python_general_be_lib-0.5.2}/general/interface/repository/__init__.py
RENAMED
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|