Skip to content

Commit 1b4daa2

Browse files
committed
add _default clarification in docs
1 parent cd6d9c8 commit 1b4daa2

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

docs/queries/create.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,9 @@ Combination of create and get methods.
6363
Tries to get a row meeting the criteria and if `NoMatch` exception is raised it creates
6464
a new one with given kwargs and _defaults.
6565

66+
When `_defaults` dictionary is provided the values set in `_defaults` will **always** be set, including overwriting explicitly provided values.
67+
i.e. `get_or_create(_defaults: {"title": "I win"}, title="never used")` will always use "I win" as title whether you provide your own value in kwargs or not.
68+
6669
```python
6770
class Album(ormar.Model):
6871
class Meta:
@@ -187,4 +190,4 @@ from other side of the relation.
187190
[models-save]: ../models/methods.md#save
188191
[models-upsert]: ../models/methods.md#upsert
189192
[models-save-related]: ../models/methods.md#save_related
190-
[querysetproxy]: ../relations/queryset-proxy.md
193+
[querysetproxy]: ../relations/queryset-proxy.md

0 commit comments

Comments
 (0)