jararaca 0.2.37a7__py3-none-any.whl → 0.2.37a9__py3-none-any.whl
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.
Potentially problematic release.
This version of jararaca might be problematic. Click here for more details.
- jararaca/__init__.py +6 -0
- jararaca/persistence/utilities.py +24 -0
- {jararaca-0.2.37a7.dist-info → jararaca-0.2.37a9.dist-info}/METADATA +1 -1
- {jararaca-0.2.37a7.dist-info → jararaca-0.2.37a9.dist-info}/RECORD +8 -8
- pyproject.toml +1 -1
- {jararaca-0.2.37a7.dist-info → jararaca-0.2.37a9.dist-info}/LICENSE +0 -0
- {jararaca-0.2.37a7.dist-info → jararaca-0.2.37a9.dist-info}/WHEEL +0 -0
- {jararaca-0.2.37a7.dist-info → jararaca-0.2.37a9.dist-info}/entry_points.txt +0 -0
jararaca/__init__.py
CHANGED
|
@@ -16,8 +16,10 @@ if TYPE_CHECKING:
|
|
|
16
16
|
from jararaca.persistence.sort_filter import (
|
|
17
17
|
FILTER_SORT_ENTITY_ATTR_MAP,
|
|
18
18
|
FilterModel,
|
|
19
|
+
FilterRuleApplier,
|
|
19
20
|
SortFilterRunner,
|
|
20
21
|
SortModel,
|
|
22
|
+
SortRuleApplier,
|
|
21
23
|
)
|
|
22
24
|
from jararaca.presentation.hooks import (
|
|
23
25
|
raises_200_on,
|
|
@@ -112,6 +114,8 @@ if TYPE_CHECKING:
|
|
|
112
114
|
from .tools.app_config.interceptor import AppConfigurationInterceptor
|
|
113
115
|
|
|
114
116
|
__all__ = [
|
|
117
|
+
"FilterRuleApplier",
|
|
118
|
+
"SortRuleApplier",
|
|
115
119
|
"use_bus_message_controller",
|
|
116
120
|
"ack",
|
|
117
121
|
"nack",
|
|
@@ -210,6 +214,8 @@ if TYPE_CHECKING:
|
|
|
210
214
|
__SPEC_PARENT__: str = __spec__.parent # type: ignore
|
|
211
215
|
# A mapping of {<member name>: (package, <module name>)} defining dynamic imports
|
|
212
216
|
_dynamic_imports: "dict[str, tuple[str, str, str | None]]" = {
|
|
217
|
+
"FilterRuleApplier": (__SPEC_PARENT__, "persistence.sort_filter", None),
|
|
218
|
+
"SortRuleApplier": (__SPEC_PARENT__, "persistence.sort_filter", None),
|
|
213
219
|
"use_bus_message_controller": (
|
|
214
220
|
__SPEC_PARENT__,
|
|
215
221
|
"messagebus.bus_message_controller",
|
|
@@ -72,9 +72,33 @@ class IdentifiableEntity(BaseEntity):
|
|
|
72
72
|
|
|
73
73
|
@classmethod
|
|
74
74
|
def from_identifiable(cls, model: Identifiable[T_BASEMODEL]) -> "Self":
|
|
75
|
+
"""
|
|
76
|
+
Converts an Identifiable model instance to an instance of the calling class.
|
|
77
|
+
This method takes an instance of a class that implements the Identifiable interface
|
|
78
|
+
and uses its `id` and `data` attributes to create a new instance of the calling class.
|
|
79
|
+
Args:
|
|
80
|
+
model (Identifiable[T_BASEMODEL]): An instance of a class that implements the Identifiable interface.
|
|
81
|
+
Returns:
|
|
82
|
+
Self: A new instance of the calling class with attributes populated from the model.
|
|
83
|
+
Deprecated:
|
|
84
|
+
This method is deprecated and will be removed in a future release.
|
|
85
|
+
"""
|
|
86
|
+
|
|
75
87
|
return cls(**{"id": model.id, **model.data.model_dump()})
|
|
76
88
|
|
|
77
89
|
def to_identifiable(self, MODEL: Type[T_BASEMODEL]) -> Identifiable[T_BASEMODEL]:
|
|
90
|
+
"""
|
|
91
|
+
Converts the current instance to an Identifiable object of the specified model type.
|
|
92
|
+
Args:
|
|
93
|
+
MODEL (Type[T_BASEMODEL]): The model type to convert the current instance to.
|
|
94
|
+
Returns:
|
|
95
|
+
Identifiable[T_BASEMODEL]: An Identifiable object containing the id and data of the current instance.
|
|
96
|
+
Raises:
|
|
97
|
+
ValidationError: If the conversion fails due to validation errors.
|
|
98
|
+
Note:
|
|
99
|
+
This method is **deprecated** and may be removed in future versions.
|
|
100
|
+
|
|
101
|
+
"""
|
|
78
102
|
try:
|
|
79
103
|
return Identifiable[MODEL].model_validate( # type: ignore[valid-type]
|
|
80
104
|
{"id": self.id, "data": recursive_get_dict(self)}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
|
|
2
2
|
README.md,sha256=mte30I-ZEJJp-Oax-OganNgl6G9GaCZPL6JVFAvZGz4,7034
|
|
3
|
-
pyproject.toml,sha256=
|
|
4
|
-
jararaca/__init__.py,sha256=
|
|
3
|
+
pyproject.toml,sha256=2UOhWHtsEocbNG2dLDU2dLKDKluERP8cFYHdnh8L990,1839
|
|
4
|
+
jararaca/__init__.py,sha256=gDCvrIhIu5_IkKjmZmhWZ2khOi8WGiw2AidFFe-BnWU,15118
|
|
5
5
|
jararaca/__main__.py,sha256=-O3vsB5lHdqNFjUtoELDF81IYFtR-DSiiFMzRaiSsv4,67
|
|
6
6
|
jararaca/cli.py,sha256=JKk4xrRbtX2fM8yYw794lbxvJFH73bWw3GGIvrpAkeE,5706
|
|
7
7
|
jararaca/common/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -30,7 +30,7 @@ jararaca/persistence/interceptors/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeR
|
|
|
30
30
|
jararaca/persistence/interceptors/aiosqa_interceptor.py,sha256=H6ZjOdosYGCZUzKjugiXQwJkAbnsL4HnkZLOEQhULEc,1986
|
|
31
31
|
jararaca/persistence/session.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
32
32
|
jararaca/persistence/sort_filter.py,sha256=agggpN0YvNjUr6wJjy69NkaqxoDDW13ys9B3r85OujA,9226
|
|
33
|
-
jararaca/persistence/utilities.py,sha256=
|
|
33
|
+
jararaca/persistence/utilities.py,sha256=0v1YrK-toTCgtw8aROtrDMNfjo3qWWNAb5qQcCOdSUU,13681
|
|
34
34
|
jararaca/presentation/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
35
35
|
jararaca/presentation/decorators.py,sha256=eL2YCgMSr19m4YCri5PQU46NRxf0QxsqDnz6MqKu0YQ,8389
|
|
36
36
|
jararaca/presentation/hooks.py,sha256=WBbU5DG3-MAm2Ro2YraQyYG_HENfizYfyShL2ktHi6k,1980
|
|
@@ -59,8 +59,8 @@ jararaca/tools/app_config/decorators.py,sha256=-ckkMZ1dswOmECdo1rFrZ15UAku--txaN
|
|
|
59
59
|
jararaca/tools/app_config/interceptor.py,sha256=nfFZiS80hrbnL7-XEYrwmp2rwaVYBqxvqu3Y-6o_ov4,2575
|
|
60
60
|
jararaca/tools/metadata.py,sha256=7nlCDYgItNybentPSSCc2MLqN7IpBd0VyQzfjfQycVI,1402
|
|
61
61
|
jararaca/tools/typescript/interface_parser.py,sha256=l-QyPVntATcbL4JYm48xq2gNWfV1y2iArvOuIueFi8w,28829
|
|
62
|
-
jararaca-0.2.
|
|
63
|
-
jararaca-0.2.
|
|
64
|
-
jararaca-0.2.
|
|
65
|
-
jararaca-0.2.
|
|
66
|
-
jararaca-0.2.
|
|
62
|
+
jararaca-0.2.37a9.dist-info/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
|
|
63
|
+
jararaca-0.2.37a9.dist-info/METADATA,sha256=RkVCVzBHDnAGBl11qdhtmRoYnQcE4AOEKrF6I0Oip3U,8554
|
|
64
|
+
jararaca-0.2.37a9.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
|
|
65
|
+
jararaca-0.2.37a9.dist-info/entry_points.txt,sha256=WIh3aIvz8LwUJZIDfs4EeH3VoFyCGEk7cWJurW38q0I,45
|
|
66
|
+
jararaca-0.2.37a9.dist-info/RECORD,,
|
pyproject.toml
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|