Skip to content

Commit 8c22aae

Browse files
committed
Merge branch 'get_or_create_with_joins'
2 parents bf280b1 + 58f3e11 commit 8c22aae

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

CHANGES

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

4+
0.38.1
5+
------
6+
Minor changes to ``get_or_create`` to make sure it handles joins correctly.
7+
8+
.. code-block:: python
9+
10+
instance = (
11+
Band.objects()
12+
.get_or_create(
13+
(Band.name == "My new band")
14+
& (Band.manager.name == "Excellent manager")
15+
)
16+
.run_sync()
17+
)
18+
19+
In this situation, there are two columns called ``name`` - we need to make sure
20+
the correct value is applied if the row doesn't exist.
21+
422
0.38.0
523
------
624
``get_or_create`` now supports more complex where clauses. For example:

piccolo/__init__.py

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

0 commit comments

Comments
 (0)