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

Allow optional primary key mapping #3

Open
DefiDebauchery opened this issue Dec 8, 2023 · 0 comments
Open

Allow optional primary key mapping #3

DefiDebauchery opened this issue Dec 8, 2023 · 0 comments

Comments

@DefiDebauchery
Copy link

Collections are great, but they're even better when being able to quickly access a member of that collection instead of having to scan through it.

For example, using the README: your model has a an id field; setting up the Collection to utilize the id as a key would then allow you to access a specific user via something like users.get(2). Other Collections might opt for other data attributes as an indexed key.

Obviously this adds a little complexity because Collection becomes a dict instead of a list, but the utility seems worthwhile.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant