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

Multiple models of the same type/class not possible to share #154

Open
ahilloffis opened this issue Jan 13, 2025 · 1 comment
Open

Multiple models of the same type/class not possible to share #154

ahilloffis opened this issue Jan 13, 2025 · 1 comment
Assignees

Comments

@ahilloffis
Copy link

It is currently not possible to share multiple instances of the same class within the context.

As a workaround, a new class with a list of the original instances can be used but it creates boilerplate code.

One solution could be to use id() function to separate instances instead of the instance type. But this means that get_or_create_model may return a list of instances or by convention returns the first occurrence.

But using id() opens the possibility to subscribe for updates only for one specific model (and as an extra feature to a class in general).

@rcschrg rcschrg self-assigned this Jan 13, 2025
@rcschrg
Copy link
Member

rcschrg commented Jan 13, 2025

Similar to #78

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

2 participants