Skip to content

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

@ahilloffis

Description

@ahilloffis

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).

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions