Skip to content

Commit ceb12d9

Browse files
committed
bumped version
1 parent 0c0b3b8 commit ceb12d9

File tree

2 files changed

+24
-1
lines changed

2 files changed

+24
-1
lines changed

CHANGES

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,29 @@
11
Changes
22
=======
33

4+
0.39.0
5+
------
6+
Added ``to_dict`` method to ``Table``.
7+
8+
If you just use ``__dict__`` on a ``Table`` instance, you get some non-column
9+
values. By using ``to_dict`` it's just the column values. Here's an example:
10+
11+
.. code-block:: python
12+
13+
class MyTable(Table):
14+
name = Varchar()
15+
16+
instance = MyTable.objects().first().run_sync()
17+
18+
>>> instance.__dict__
19+
{'_exists_in_db': True, 'id': 1, 'name': 'foo'}
20+
21+
>>> instance.to_dict()
22+
{'id': 1, 'name': 'foo'}
23+
24+
Thanks to @wmshort for the idea, and @aminalaee and @sinisaos for investigating
25+
edge cases.
26+
427
0.38.2
528
------
629
Removed problematic type hint which assumed pytest was installed.

piccolo/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__VERSION__ = "0.38.2"
1+
__VERSION__ = "0.39.0"

0 commit comments

Comments
 (0)