mirror of
https://github.com/ets-labs/python-dependency-injector.git
synced 2024-11-28 20:44:01 +03:00
19 lines
485 B
Python
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)
|