mirror of
https://github.com/ets-labs/python-dependency-injector.git
synced 2025-10-25 05:01:11 +03:00
* Add overriding functionality on declarative container initialization * Update changelog * Update bundles example
21 lines
633 B
Python
21 lines
633 B
Python
"""Photos bundle."""
|
|
|
|
from dependency_injector import containers
|
|
from dependency_injector import providers
|
|
|
|
from . import entities
|
|
from . import repositories
|
|
|
|
|
|
class Photos(containers.DeclarativeContainer):
|
|
"""Photos bundle container."""
|
|
|
|
database = providers.Dependency()
|
|
file_storage = providers.Dependency()
|
|
|
|
photo = providers.Factory(entities.Photo)
|
|
photo_repository = providers.Singleton(repositories.PhotoRepository,
|
|
object_factory=photo.provider,
|
|
fs=file_storage,
|
|
db=database)
|