mirror of
https://github.com/ets-labs/python-dependency-injector.git
synced 2024-11-26 19:43:58 +03:00
18 lines
356 B
Python
18 lines
356 B
Python
|
from dependency_injector import containers, providers
|
||
|
|
||
|
from .service import Service
|
||
|
|
||
|
|
||
|
class SubContainer(containers.DeclarativeContainer):
|
||
|
|
||
|
int_object = providers.Object(1)
|
||
|
|
||
|
|
||
|
class Container(containers.DeclarativeContainer):
|
||
|
|
||
|
config = providers.Configuration()
|
||
|
|
||
|
service = providers.Factory(Service)
|
||
|
|
||
|
sub = providers.Container(SubContainer)
|