You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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 theid
as a key would then allow you to access a specific user via something likeusers.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.
The text was updated successfully, but these errors were encountered: