mirror of
https://github.com/ets-labs/python-dependency-injector.git
synced 2024-11-24 02:24:02 +03:00
29f209d382
* Fix dependency provider stub issue with required init arg * Refactor bundles example app * Rename bundles package * Rename bundles example container * Rename bundles mini app to decoupled packages * Move decoupled packages example to main examples * Fix a typo * Add meta
21 lines
483 B
Python
21 lines
483 B
Python
"""Photo containers module."""
|
|
|
|
from dependency_injector import containers, providers
|
|
|
|
from . import entities, repositories
|
|
|
|
|
|
class PhotoContainer(containers.DeclarativeContainer):
|
|
|
|
database = providers.Dependency()
|
|
file_storage = providers.Dependency()
|
|
|
|
photo = providers.Factory(entities.Photo)
|
|
|
|
photo_repository = providers.Singleton(
|
|
repositories.PhotoRepository,
|
|
entity_factory=photo.provider,
|
|
fs=file_storage,
|
|
db=database,
|
|
)
|