You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/queries/create.md
+4-1Lines changed: 4 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -63,6 +63,9 @@ Combination of create and get methods.
63
63
Tries to get a row meeting the criteria and if `NoMatch` exception is raised it creates
64
64
a new one with given kwargs and _defaults.
65
65
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
+
66
69
```python
67
70
classAlbum(ormar.Model):
68
71
classMeta:
@@ -187,4 +190,4 @@ from other side of the relation.
0 commit comments