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
Is your feature request related to a problem? Please describe.
I'm coming from Django and I'm used to having first() return None if there are no matches. Ormar should either replicate this behavior or introduce first_or_none method to go in sync with other _or_none methods.
Side note: Documentation for get() and get_or_none() is misleading as it reads "Returns first row" which sadly is not true because it raises MultipleMatches if there are more rows matching criteria.
Describe the solution you'd like
I already have a PR adding first_or_none but the docs suggest opening an issue beforehand 😉
Side note: mypy's pre-commit hook yields a lot of errors from other code in the repo.
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem? Please describe.
I'm coming from Django and I'm used to having
first()
return None if there are no matches. Ormar should either replicate this behavior or introducefirst_or_none
method to go in sync with other_or_none
methods.Side note: Documentation for
get()
andget_or_none()
is misleading as it reads "Returns first row" which sadly is not true because it raisesMultipleMatches
if there are more rows matching criteria.Describe the solution you'd like
I already have a PR adding
first_or_none
but the docs suggest opening an issue beforehand 😉Side note: mypy's pre-commit hook yields a lot of errors from other code in the repo.
The text was updated successfully, but these errors were encountered: