add one_or_404 method to BaseQuery#527
Closed
guillp wants to merge 3 commits intopallets-eco:mainfrom
guillp:master
Closed
add one_or_404 method to BaseQuery#527guillp wants to merge 3 commits intopallets-eco:mainfrom guillp:master
guillp wants to merge 3 commits intopallets-eco:mainfrom
guillp:master
Conversation
one_or_404 helper method, just like first_or_404 and get_or_404
Contributor
|
LGTM, but I'd uppercase the first character of the commit message ;) |
Updated 'Queries in Views' documentation with the new helper method `one_or_404`()
Member
|
|
Contributor
|
Adding to milestone 3.0. But this needs a test written. |
Lukas0907
added a commit
to Lukas0907/flask-sqlalchemy
that referenced
this pull request
Jan 20, 2021
Thanks to Guillaume Pujol <guill.p.linux@gmail.com>. Closes: pallets-eco#527
|
Hi, I've rebased the code from @guillp to master and added a test. Please take a look: Lukas0907@1ab6499 |
Member
|
added in #1087 |
This pull request was closed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This adds
one_or_404()helper method in BaseQuery, based on SQLAlchemyone_or_none().This complements the existing
first_or_404()andget_or_404()based onget()andfirst().