Open
Description
I'm trying to define a container that only provides instances that extend Foo
, however, some of these instances depend on things provided by other containers. Is this possible and what would the best approach be? Here's a sample mostly taken from multiple parts of your docs:
class MainContainer(DeclarativeContainer):
some_client = Singleton(SomeClient)
class SpecificProvider(Singleton):
provided_type = SpecificThing
class SpecificThingsContainer(DeclarativeContainer):
provider_type = SpecificProvider
# this causes an error
# if possible, I would actually prefer to hide this from the public interface of my "things" container
main_container = DependenciesContainer()
# how do I define this dependency on SomeClient?
one_thing = SpecificProvider(SpecificThing, client=main_container.some_client)