python-dependency-injector/examples/miniapps/applications/example/users/__init__.py
2017-12-20 12:25:46 +02:00

19 lines
485 B
Python

"""Users package."""
from core import containers
from core import providers
from . import entities
from . import repositories
class Users(containers.DeclarativeContainer):
"""Users container."""
database = providers.Dependency()
user = providers.Factory(entities.User)
user_repository = providers.Singleton(repositories.UserRepository,
object_factory=user.provider,
db=database)