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

Scalar Attribute Proxies #61

Open
amcgregor opened this issue Dec 24, 2019 · 0 comments
Open

Scalar Attribute Proxies #61

amcgregor opened this issue Dec 24, 2019 · 0 comments
Labels
2.enhancement New ideas or improvements. need:example For task completion, one or more examples are required.

Comments

@amcgregor
Copy link
Member

amcgregor commented Dec 24, 2019

Getting this idea out of my brain onto "paper" while it's fresh, permit the return of scalar attribute proxies from find_one(), that is, an apparent instance of the targeted Document sub–class that upon access to an attribute (field descriptor) or subscript (dictionary-like access redirected to the underlying backing dict), performs the query needed to retrieve just that value. Example name, following the overall naming pattern: find_scalar()

This may be more natural than pre-defining an iterable of fields to retrieve, then unpacking a resulting tuple of those retrieved values. (Sometimes you don't want your data cached application-side… but still want the benefit of those descriptor objects.)

@amcgregor amcgregor added 2.enhancement New ideas or improvements. need:example For task completion, one or more examples are required. labels Dec 24, 2019
@amcgregor amcgregor pinned this issue Aug 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2.enhancement New ideas or improvements. need:example For task completion, one or more examples are required.
Projects
None yet
Development

No branches or pull requests

1 participant