Skip to content

Commit 37c8997

Browse files
committed
bumped version
1 parent 65c5871 commit 37c8997

2 files changed

Lines changed: 68 additions & 1 deletion

File tree

CHANGES.rst

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

4+
1.36.0
5+
------
6+
7+
Advanced Constraints
8+
~~~~~~~~~~~~~~~~~~~~
9+
10+
Added support for composite unique constraints. Many thanks to @atkei for this.
11+
12+
For example:
13+
14+
.. code-block:: python
15+
16+
from piccolo.constraints import Unique
17+
18+
class Album(Table):
19+
name = Varchar()
20+
band = ForeignKey(Band)
21+
22+
unique_name_band = Unique([name, band])
23+
24+
And check constraints:
25+
26+
.. code-block:: python
27+
28+
from piccolo.constraints import Check
29+
30+
class Ticket(Table):
31+
price = Decimal()
32+
33+
check_price_positive = Check(price >= 0)
34+
35+
Replaced ``SelectRaw``, ``GroupByRaw`` and ``OrderByRaw`` with ``QueryString``
36+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
37+
38+
In certain situations we allow the user to modify Piccolo queries using
39+
custom SQL. This is for advanced situations not covered natively by the ORM.
40+
41+
In the past we used custom classes for this - ``SelectRaw``, ``OrderByRaw``
42+
etc.
43+
44+
These classes still work, but you can now just pass in a ``QueryString``
45+
instead (the building block of queries in Piccolo).
46+
47+
.. code-block:: python
48+
49+
from piccolo.querystring import QueryString
50+
51+
await Band.select(Band.name).order_by(
52+
QueryString('random()'),
53+
)
54+
55+
Other changes
56+
~~~~~~~~~~~~~
57+
58+
* Improved error messages when running migrations (thanks to @pctablet505 and
59+
@AnayGarodia for this).
60+
* Upgraded ``colorama``, so Piccolo works nicer with other libraries also
61+
using ``colorama`` (thanks to @laravioli for reporting this issue).
62+
* Fixed a bug using ``load_json`` and ``prefetch`` together, when the JSON
63+
column contains an array value (thanks to @Mekagojira8 for reporting this
64+
issue).
65+
* Fixed bugs with title case column names (thanks to @devzzzero for reporting
66+
this).
67+
68+
-------------------------------------------------------------------------------
69+
470
1.35.0
571
------
672

@@ -68,6 +134,7 @@ Convert ``Timestamptz`` columns from UTC to another timezone:
68134
Similar to ``Varchar`` - useful if the strings are a fixed width.
69135

70136
.. code-block:: python
137+
71138
class Venue(Table):
72139
country_code = Char(length=2)
73140

piccolo/__init__.py

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

0 commit comments

Comments
 (0)