Skip to content

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#527
guillp wants to merge 3 commits intopallets-eco:mainfrom
guillp:master

Conversation

@guillp
Copy link

@guillp guillp commented Aug 11, 2017

This adds one_or_404() helper method in BaseQuery, based on SQLAlchemy one_or_none().
This complements the existing first_or_404() and get_or_404() based on get() and first().

one_or_404 helper method, just like first_or_404 and get_or_404
@ThiefMaster
Copy link
Contributor

LGTM, but I'd uppercase the first character of the commit message ;)

guillp added 2 commits August 11, 2017 14:59
Updated 'Queries in Views' documentation with the new helper method `one_or_404`()
@davidism
Copy link
Member

one_or_none was added in SQLAlchemy 1.0.9. The minimum supported version is 0.8. While that should probably be bumped to at least 1.0 in the next major release, I can't merge this as is until that happens.

@rsyring
Copy link
Contributor

rsyring commented Mar 9, 2019

Adding to milestone 3.0. But this needs a test written.

@rsyring rsyring added this to the 3.0 milestone Mar 9, 2019
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
@Lukas0907
Copy link

Hi,

I've rebased the code from @guillp to master and added a test.

Please take a look: Lukas0907@1ab6499

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 4, 2022
@davidism davidism removed this from the 3.0 milestone Sep 18, 2022
@davidism
Copy link
Member

added in #1087

This pull request was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

Comments