belgie-alchemy 0.1.0a4__py3-none-any.whl → 0.3.0__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.
- belgie_alchemy/__init__.py +0 -26
- {belgie_alchemy-0.1.0a4.dist-info → belgie_alchemy-0.3.0.dist-info}/METADATA +43 -33
- belgie_alchemy-0.3.0.dist-info/RECORD +7 -0
- {belgie_alchemy-0.1.0a4.dist-info → belgie_alchemy-0.3.0.dist-info}/WHEEL +1 -1
- belgie_alchemy/__tests__/__init__.py +0 -0
- belgie_alchemy/__tests__/adapter/__init__.py +0 -0
- belgie_alchemy/__tests__/adapter/test_adapter.py +0 -493
- belgie_alchemy/__tests__/auth_models/__init__.py +0 -0
- belgie_alchemy/__tests__/auth_models/test_auth_models.py +0 -91
- belgie_alchemy/__tests__/base/__init__.py +0 -0
- belgie_alchemy/__tests__/base/test_base.py +0 -90
- belgie_alchemy/__tests__/conftest.py +0 -39
- belgie_alchemy/__tests__/fixtures/__init__.py +0 -12
- belgie_alchemy/__tests__/fixtures/database.py +0 -38
- belgie_alchemy/__tests__/fixtures/models.py +0 -119
- belgie_alchemy/__tests__/mixins/__init__.py +0 -0
- belgie_alchemy/__tests__/mixins/test_mixins.py +0 -80
- belgie_alchemy/__tests__/settings/__init__.py +0 -0
- belgie_alchemy/__tests__/settings/test_settings.py +0 -342
- belgie_alchemy/__tests__/settings/test_settings_integration.py +0 -416
- belgie_alchemy/__tests__/types/__init__.py +0 -0
- belgie_alchemy/__tests__/types/test_types.py +0 -155
- belgie_alchemy/base.py +0 -25
- belgie_alchemy/mixins.py +0 -83
- belgie_alchemy/types.py +0 -32
- belgie_alchemy-0.1.0a4.dist-info/RECORD +0 -28
belgie_alchemy/types.py
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
from datetime import UTC, datetime
|
|
2
|
-
from typing import Any
|
|
3
|
-
|
|
4
|
-
from sqlalchemy import DateTime
|
|
5
|
-
from sqlalchemy.types import TypeDecorator
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
class DateTimeUTC(TypeDecorator[datetime]):
|
|
9
|
-
impl = DateTime(timezone=True)
|
|
10
|
-
cache_ok = True
|
|
11
|
-
|
|
12
|
-
def process_bind_param(self, value: datetime | None, _dialect: Any) -> datetime | None: # type: ignore[override] # noqa: ANN401
|
|
13
|
-
if value is None:
|
|
14
|
-
return None
|
|
15
|
-
if not isinstance(value, datetime):
|
|
16
|
-
type_name = type(value).__name__
|
|
17
|
-
msg = (
|
|
18
|
-
f"DateTimeUTC requires datetime object, got {type_name}. "
|
|
19
|
-
f"If using a date, convert to datetime first: "
|
|
20
|
-
f"datetime.combine(your_date, time())"
|
|
21
|
-
)
|
|
22
|
-
raise TypeError(msg)
|
|
23
|
-
if value.tzinfo is None:
|
|
24
|
-
value = value.replace(tzinfo=UTC)
|
|
25
|
-
return value.astimezone(UTC)
|
|
26
|
-
|
|
27
|
-
def process_result_value(self, value: Any, _dialect: Any) -> datetime | None: # type: ignore[override] # noqa: ANN401
|
|
28
|
-
if value is None:
|
|
29
|
-
return None
|
|
30
|
-
if value.tzinfo is None:
|
|
31
|
-
value = value.replace(tzinfo=UTC)
|
|
32
|
-
return value.astimezone(UTC)
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
belgie_alchemy/__init__.py,sha256=zK7g-06wUYg1ThS389aPFnAOK38osQQwtw0ZizUajDc,1070
|
|
2
|
-
belgie_alchemy/__tests__/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
3
|
-
belgie_alchemy/__tests__/adapter/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
4
|
-
belgie_alchemy/__tests__/adapter/test_adapter.py,sha256=-tlLCqihEkJXJRloeLVRtbPdIfpKMQ3axsfs7xZRRTk,16064
|
|
5
|
-
belgie_alchemy/__tests__/auth_models/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
6
|
-
belgie_alchemy/__tests__/auth_models/test_auth_models.py,sha256=RQNaGfmvGNIrndgokueKMxvR9uMnOoj9N7FKVTAkM9o,2741
|
|
7
|
-
belgie_alchemy/__tests__/base/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
8
|
-
belgie_alchemy/__tests__/base/test_base.py,sha256=XZVy2eoutSOpDdufvZkEc7uJmmVOyxOh9HJkjsCcimM,3298
|
|
9
|
-
belgie_alchemy/__tests__/conftest.py,sha256=S_c1HqCF3fviRnAcox0ZwKPcKiAPOcfEDMguJRNqqNE,1190
|
|
10
|
-
belgie_alchemy/__tests__/fixtures/__init__.py,sha256=Ldyp56D1LrPVvJHcXfyvxtskqbeqXZqme-FNnNBb-oE,347
|
|
11
|
-
belgie_alchemy/__tests__/fixtures/database.py,sha256=yKYkRQcdbZ9wGDNWhn6tDhY-rF2QQz0oibEb2LSoFdY,1129
|
|
12
|
-
belgie_alchemy/__tests__/fixtures/models.py,sha256=ftWLG-MkqmUa1Z_Yp7pon6m84qLbtJo9XmCYiYYlsTo,3822
|
|
13
|
-
belgie_alchemy/__tests__/mixins/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
14
|
-
belgie_alchemy/__tests__/mixins/test_mixins.py,sha256=0OQWWTc0fs_CN_4lrvVJgxrXji5mfn0wgRyRVJd_4gU,2419
|
|
15
|
-
belgie_alchemy/__tests__/settings/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
16
|
-
belgie_alchemy/__tests__/settings/test_settings.py,sha256=jW7ZtTDfkBSX9AJYUKe5HSm2AjGSd-D51BFoRRVCIAA,11263
|
|
17
|
-
belgie_alchemy/__tests__/settings/test_settings_integration.py,sha256=StkOTvfssTG8lvyAa_r-pdyyO1e6vC8IeRQJMuRr7hc,15480
|
|
18
|
-
belgie_alchemy/__tests__/types/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
19
|
-
belgie_alchemy/__tests__/types/test_types.py,sha256=bTMlfmyCJRLKsZ0Hj-4gor9xlbPTfteR0S0pqzaWR-8,5300
|
|
20
|
-
belgie_alchemy/adapter.py,sha256=30ePooceD1O40WpODfEycxc4KaOKx_71GiCJqqF1rRE,10305
|
|
21
|
-
belgie_alchemy/base.py,sha256=x-AddtIS4aBzA8p7exFDK-AYpMZ9HdhuwzmcdpPZ74g,843
|
|
22
|
-
belgie_alchemy/mixins.py,sha256=rn3zXiU-UdyEcYOBNpy8p5JFkJRVzr6QaL_kk2VfoV8,3090
|
|
23
|
-
belgie_alchemy/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
24
|
-
belgie_alchemy/settings.py,sha256=0zK-GDEVzmI3efEceWGV7H3jieW63gqZHVJ4vgJVlMM,4991
|
|
25
|
-
belgie_alchemy/types.py,sha256=BJ_rL5Ce5TyVV-C3I20VukA8A3Qifxzch-0OY1lqAcQ,1177
|
|
26
|
-
belgie_alchemy-0.1.0a4.dist-info/WHEEL,sha256=fAguSjoiATBe7TNBkJwOjyL1Tt4wwiaQGtNtjRPNMQA,80
|
|
27
|
-
belgie_alchemy-0.1.0a4.dist-info/METADATA,sha256=N0hl6JhUuzWWNqZeZft17_pz1Qr725fmpEulnILq-p0,7005
|
|
28
|
-
belgie_alchemy-0.1.0a4.dist-info/RECORD,,
|