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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

馃挕 Make collections indexable by names #45

Closed
demberto opened this issue Sep 17, 2022 · 0 comments
Closed

馃挕 Make collections indexable by names #45

demberto opened this issue Sep 17, 2022 · 0 comments
Assignees
Labels
enhancement New feature or request models High-level API
Milestone

Comments

@demberto
Copy link
Owner

Currently, model collections like Patterns, ChannelRack, Arrangements, Mixer, Insert and so on implement __getitem__ to allow passing an index of the model.

Example:

project.arrangements[1]    # Arrangement(name="...", ...)

This works, but has little value practically speaking. Nobody remembers the index of the pattern or much less of a channel.
Models have a name property which can be used as a parameter for the __getitem__ method. Once that is done,

project.arrangements["arrangement_name"]    # returns an Arrangement with that name
@demberto demberto added the enhancement New feature or request label Sep 17, 2022
@demberto demberto added this to the PyFLP 2.0.0 milestone Sep 17, 2022
@demberto demberto self-assigned this Sep 17, 2022
@demberto demberto changed the title feat: Make collections indexable by names 馃挕 Make collections indexable by names Sep 17, 2022
@demberto demberto added the models High-level API label Oct 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request models High-level API
Projects
None yet
Development

No branches or pull requests

1 participant