piccolo 1.24.0__py3-none-any.whl → 1.24.1__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.
- piccolo/__init__.py +1 -1
- piccolo/columns/defaults/timestamp.py +5 -1
- piccolo/columns/defaults/timestamptz.py +3 -1
- {piccolo-1.24.0.dist-info → piccolo-1.24.1.dist-info}/METADATA +3 -2
- {piccolo-1.24.0.dist-info → piccolo-1.24.1.dist-info}/RECORD +10 -10
- {piccolo-1.24.0.dist-info → piccolo-1.24.1.dist-info}/WHEEL +1 -1
- tests/columns/test_defaults.py +34 -0
- {piccolo-1.24.0.dist-info → piccolo-1.24.1.dist-info}/entry_points.txt +0 -0
- {piccolo-1.24.0.dist-info → piccolo-1.24.1.dist-info/licenses}/LICENSE +0 -0
- {piccolo-1.24.0.dist-info → piccolo-1.24.1.dist-info}/top_level.txt +0 -0
piccolo/__init__.py
CHANGED
@@ -1 +1 @@
|
|
1
|
-
__VERSION__ = "1.24.
|
1
|
+
__VERSION__ = "1.24.1"
|
@@ -70,6 +70,7 @@ class TimestampCustom(Default):
|
|
70
70
|
month: int = 1,
|
71
71
|
day: int = 1,
|
72
72
|
hour: int = 0,
|
73
|
+
minute: int = 0,
|
73
74
|
second: int = 0,
|
74
75
|
microsecond: int = 0,
|
75
76
|
):
|
@@ -77,6 +78,7 @@ class TimestampCustom(Default):
|
|
77
78
|
self.month = month
|
78
79
|
self.day = day
|
79
80
|
self.hour = hour
|
81
|
+
self.minute = minute
|
80
82
|
self.second = second
|
81
83
|
self.microsecond = microsecond
|
82
84
|
|
@@ -87,6 +89,7 @@ class TimestampCustom(Default):
|
|
87
89
|
month=self.month,
|
88
90
|
day=self.day,
|
89
91
|
hour=self.hour,
|
92
|
+
minute=self.minute,
|
90
93
|
second=self.second,
|
91
94
|
microsecond=self.microsecond,
|
92
95
|
)
|
@@ -113,8 +116,9 @@ class TimestampCustom(Default):
|
|
113
116
|
return cls(
|
114
117
|
year=instance.year,
|
115
118
|
month=instance.month,
|
116
|
-
day=instance.
|
119
|
+
day=instance.day,
|
117
120
|
hour=instance.hour,
|
121
|
+
minute=instance.minute,
|
118
122
|
second=instance.second,
|
119
123
|
microsecond=instance.microsecond,
|
120
124
|
)
|
@@ -47,6 +47,7 @@ class TimestamptzCustom(TimestampCustom):
|
|
47
47
|
month=self.month,
|
48
48
|
day=self.day,
|
49
49
|
hour=self.hour,
|
50
|
+
minute=self.minute,
|
50
51
|
second=self.second,
|
51
52
|
microsecond=self.microsecond,
|
52
53
|
tzinfo=datetime.timezone.utc,
|
@@ -59,8 +60,9 @@ class TimestamptzCustom(TimestampCustom):
|
|
59
60
|
return cls(
|
60
61
|
year=instance.year,
|
61
62
|
month=instance.month,
|
62
|
-
day=instance.
|
63
|
+
day=instance.day,
|
63
64
|
hour=instance.hour,
|
65
|
+
minute=instance.minute,
|
64
66
|
second=instance.second,
|
65
67
|
microsecond=instance.microsecond,
|
66
68
|
)
|
@@ -1,6 +1,6 @@
|
|
1
|
-
Metadata-Version: 2.
|
1
|
+
Metadata-Version: 2.4
|
2
2
|
Name: piccolo
|
3
|
-
Version: 1.24.
|
3
|
+
Version: 1.24.1
|
4
4
|
Summary: A fast, user friendly ORM and query builder which supports asyncio.
|
5
5
|
Home-page: https://github.com/piccolo-orm/piccolo
|
6
6
|
Author: Daniel Townsend
|
@@ -54,6 +54,7 @@ Dynamic: description
|
|
54
54
|
Dynamic: description-content-type
|
55
55
|
Dynamic: home-page
|
56
56
|
Dynamic: license
|
57
|
+
Dynamic: license-file
|
57
58
|
Dynamic: project-url
|
58
59
|
Dynamic: provides-extra
|
59
60
|
Dynamic: requires-dist
|
@@ -1,4 +1,4 @@
|
|
1
|
-
piccolo/__init__.py,sha256=
|
1
|
+
piccolo/__init__.py,sha256=fqbFeUPVIVzt-2TqaZSPsISdBRr5iqLv8pFlnMYP1pU,23
|
2
2
|
piccolo/custom_types.py,sha256=7HMQAze-5mieNLfbQ5QgbRQgR2abR7ol0qehv2SqROY,604
|
3
3
|
piccolo/main.py,sha256=1VsFV67FWTUikPTysp64Fmgd9QBVa_9wcwKfwj2UCEA,5117
|
4
4
|
piccolo/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
@@ -134,8 +134,8 @@ piccolo/columns/defaults/base.py,sha256=z_ZgtSFbLuwqdYdI7dr2n1SeyTJ7M4Ee4Ki7eRaB
|
|
134
134
|
piccolo/columns/defaults/date.py,sha256=Duuyi-QJ9Rr72aJkCNnjyO1CJBE-inZNGKnyV8tbLLE,2517
|
135
135
|
piccolo/columns/defaults/interval.py,sha256=ypaQpgDm1AL0WTMFEgKCt0I-e9ADUYdRRSBl65IJdiw,1987
|
136
136
|
piccolo/columns/defaults/time.py,sha256=2e0SDjl9_Mrw2YUeLFXDDYhmlC9Qjek3MkhvmWKQFH0,2417
|
137
|
-
piccolo/columns/defaults/timestamp.py,sha256=
|
138
|
-
piccolo/columns/defaults/timestamptz.py,sha256=
|
137
|
+
piccolo/columns/defaults/timestamp.py,sha256=O7SDldwDku8Bd3n0JPxUSzYo7FDYrgWgdxI-0o4sOvk,3685
|
138
|
+
piccolo/columns/defaults/timestamptz.py,sha256=9xCpIbxH4gy8UY8Ucc_OGwN9hOOzXz7PbXKaNQx6UNs,2162
|
139
139
|
piccolo/columns/defaults/uuid.py,sha256=zBBaXlUsDTKcxRFDWwqgpiDRrYd7ptxC_hf7UqYhRjY,470
|
140
140
|
piccolo/columns/operators/__init__.py,sha256=fIIm309C7ddqrP-M9oLlfhcZEM4Fx5B203QMzBm0OpM,310
|
141
141
|
piccolo/columns/operators/base.py,sha256=UfaqPd-ieqydrjhvcGYiwHMOKs199tTiT1gFE15DZzo,34
|
@@ -199,6 +199,7 @@ piccolo/utils/sync.py,sha256=j9Abkxn5HHS6HyvfpMzb1zV_teTkFHVhaIxu9rrSwSU,819
|
|
199
199
|
piccolo/utils/warnings.py,sha256=ONrurw3HVCClUuHnpenMjg45dcFesrXqMgG9ifgP4_8,1247
|
200
200
|
piccolo/utils/graphlib/__init__.py,sha256=SUJ5Yh7LiRun3nkBuLUSVmGNHF6fANrxSoYan0mtYB0,200
|
201
201
|
piccolo/utils/graphlib/_graphlib.py,sha256=9FNGDSmTIEAk86FktniCe_J2yXjSE_sRZHDBAJJAUOw,9677
|
202
|
+
piccolo-1.24.1.dist-info/licenses/LICENSE,sha256=zFIpi-16uIJ420UMIG75NU0JbDBykvrdnXcj5U_EYBI,1059
|
202
203
|
profiling/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
203
204
|
profiling/run_profile.py,sha256=264qsSFu93NTpExePnKQ9GkcN5fiuRBQ72WOSt0ZHck,829
|
204
205
|
tests/apps/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
@@ -262,7 +263,7 @@ tests/columns/test_choices.py,sha256=q8TLe7nvGERXyGO_XEryEBR-DuWwFY1jPpscsrXjdXo
|
|
262
263
|
tests/columns/test_combination.py,sha256=BuBwR7k5X1EkOWraZpjqU6gvtb6ow_k-7N1KQBiW2RA,1681
|
263
264
|
tests/columns/test_date.py,sha256=QLC6kJMQwM-1mbUP4ksJVM7P8WwjzGZyynH3rHHdSew,1030
|
264
265
|
tests/columns/test_db_column_name.py,sha256=0wz6y4GNGy4nhMdHmYzEnChQGpK2UhWFFKrnmmML3Mk,9027
|
265
|
-
tests/columns/test_defaults.py,sha256=
|
266
|
+
tests/columns/test_defaults.py,sha256=SUY00eMpYSmEyl6UvGRjd_HwW5wC_tkHrwCDcYzlkUQ,3872
|
266
267
|
tests/columns/test_double_precision.py,sha256=7rhcSfDkb2fBh_zEG4UGwD_GW1sy6U9-8NooHuCS09Q,544
|
267
268
|
tests/columns/test_get_sql_value.py,sha256=mKgsInN374jzV99y9mg_ZiG-AvnJgz36SZi89xL7RZM,1768
|
268
269
|
tests/columns/test_integer.py,sha256=IcIQq0gF29gTxLY3CJuXtE13-20emqisY2wRQsu80F4,772
|
@@ -379,9 +380,8 @@ tests/utils/test_sql_values.py,sha256=vzxRmy16FfLZPH-sAQexBvsF9MXB8n4smr14qoEOS5
|
|
379
380
|
tests/utils/test_sync.py,sha256=9ytVo56y2vPQePvTeIi9lHIouEhWJbodl1TmzkGFrSo,799
|
380
381
|
tests/utils/test_table_reflection.py,sha256=SIzuat-IpcVj1GCFyOWKShI8YkhdOPPFH7qVrvfyPNE,3794
|
381
382
|
tests/utils/test_warnings.py,sha256=NvSC_cvJ6uZcwAGf1m-hLzETXCqprXELL8zg3TNLVMw,269
|
382
|
-
piccolo-1.24.
|
383
|
-
piccolo-1.24.
|
384
|
-
piccolo-1.24.
|
385
|
-
piccolo-1.24.
|
386
|
-
piccolo-1.24.
|
387
|
-
piccolo-1.24.0.dist-info/RECORD,,
|
383
|
+
piccolo-1.24.1.dist-info/METADATA,sha256=E-iRyVUdWPUJprZz1ofdSYkE9OPTLlCQAi_lguMXQlg,5531
|
384
|
+
piccolo-1.24.1.dist-info/WHEEL,sha256=1tXe9gY0PYatrMPMDd6jXqjfpz_B-Wqm32CPfRC58XU,91
|
385
|
+
piccolo-1.24.1.dist-info/entry_points.txt,sha256=SJPHET4Fi1bN5F3WqcKkv9SClK3_F1I7m4eQjk6AFh0,46
|
386
|
+
piccolo-1.24.1.dist-info/top_level.txt,sha256=-SR74VGbk43VoPy1HH-mHm97yoGukLK87HE5kdBW6qM,24
|
387
|
+
piccolo-1.24.1.dist-info/RECORD,,
|
tests/columns/test_defaults.py
CHANGED
@@ -22,6 +22,8 @@ from piccolo.columns.column_types import (
|
|
22
22
|
TimestampNow,
|
23
23
|
Varchar,
|
24
24
|
)
|
25
|
+
from piccolo.columns.defaults.timestamp import TimestampCustom
|
26
|
+
from piccolo.columns.defaults.timestamptz import TimestamptzCustom
|
25
27
|
from piccolo.table import Table
|
26
28
|
|
27
29
|
|
@@ -98,3 +100,35 @@ class TestDefaults(TestCase):
|
|
98
100
|
ForeignKey(references=MyTable, default=1)
|
99
101
|
with self.assertRaises(ValueError):
|
100
102
|
ForeignKey(references=MyTable, default="hello world")
|
103
|
+
|
104
|
+
|
105
|
+
class TestDatetime(TestCase):
|
106
|
+
|
107
|
+
def test_datetime(self):
|
108
|
+
"""
|
109
|
+
Make sure we can create a `TimestampCustom` / `TimestamptzCustom` from
|
110
|
+
a datetime, and then convert it back into the same datetime again.
|
111
|
+
|
112
|
+
https://github.com/piccolo-orm/piccolo/issues/1169
|
113
|
+
|
114
|
+
"""
|
115
|
+
datetime_obj = datetime.datetime(
|
116
|
+
year=2025,
|
117
|
+
month=1,
|
118
|
+
day=30,
|
119
|
+
hour=12,
|
120
|
+
minute=10,
|
121
|
+
second=15,
|
122
|
+
microsecond=100,
|
123
|
+
)
|
124
|
+
|
125
|
+
self.assertEqual(
|
126
|
+
TimestampCustom.from_datetime(datetime_obj).datetime,
|
127
|
+
datetime_obj,
|
128
|
+
)
|
129
|
+
|
130
|
+
datetime_obj = datetime_obj.astimezone(tz=datetime.timezone.utc)
|
131
|
+
self.assertEqual(
|
132
|
+
TimestamptzCustom.from_datetime(datetime_obj).datetime,
|
133
|
+
datetime_obj,
|
134
|
+
)
|
File without changes
|
File without changes
|
File without changes
|