fix quoting in order_by, add get_or_none

This commit is contained in:
collerek
2021-03-23 17:36:20 +01:00
parent b08d616dc0
commit 4ad843a6a5
14 changed files with 214 additions and 2 deletions

View File

@ -55,6 +55,13 @@ track == track2
If there are multiple rows meeting the criteria the `MultipleMatches` exception is raised.
## get_or_none
`get_or_none(**kwargs) -> Model`
Exact equivalent of get described above but instead of raising the exception returns `None` if no db record matching the criteria is found.
## get_or_create
`get_or_create(**kwargs) -> Model`
@ -190,6 +197,14 @@ objects from other side of the relation.
!!!tip
To read more about `QuerysetProxy` visit [querysetproxy][querysetproxy] section
### get_or_none
Exact equivalent of get described above but instead of raising the exception returns `None` if no db record matching the criteria is found.
!!!tip
To read more about `QuerysetProxy` visit [querysetproxy][querysetproxy] section
### get_or_create
Works exactly the same as [get_or_create](./#get_or_create) function above but allows