Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Quickstart: switch .first() to .scalar() for querying single record #1116

Merged
merged 1 commit into from
Oct 6, 2022
Merged

Quickstart: switch .first() to .scalar() for querying single record #1116

merged 1 commit into from
Oct 6, 2022

Conversation

carc1n0gen
Copy link
Contributor

@carc1n0gen carc1n0gen commented Oct 6, 2022

Quickstart doc should instruct to use .scalar() instead of .first() for single item queries.

With new query api .first() returns a Row object, not an instance of whatever model was queried, so it can't simply be passed to templates and used like Author.name, Post.title.

Checklist:

  • Add or update relevant docs, in the docs folder and in code.

@davidism
Copy link
Member

davidism commented Oct 6, 2022

Don't need a change entry for this, docs update as soon as they're merged.

@carc1n0gen
Copy link
Contributor Author

Updated

@davidism davidism added the docs label Oct 6, 2022
@davidism davidism merged commit 451a29a into pallets-eco:3.0.x Oct 6, 2022
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 21, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Development

Successfully merging this pull request may close these issues.

None yet

2 participants