mirror of
https://github.com/ets-labs/python-dependency-injector.git
synced 2024-11-22 09:36:48 +03:00
Update concept example in README
This commit is contained in:
parent
7b35909083
commit
4285205dca
|
@ -93,16 +93,17 @@ Examples
|
|||
class Services(catalogs.DeclarativeCatalog):
|
||||
"""Catalog of service providers."""
|
||||
|
||||
database = providers.Singleton(sqlite3.connect, ':memory:')
|
||||
database = providers.Singleton(sqlite3.connect,
|
||||
injections.Arg(':memory:'))
|
||||
""":type: providers.Provider -> sqlite3.Connection"""
|
||||
|
||||
users = providers.Factory(UsersService,
|
||||
db=database)
|
||||
injections.KwArg('db', database))
|
||||
""":type: providers.Provider -> UsersService"""
|
||||
|
||||
auth = providers.Factory(AuthService,
|
||||
db=database,
|
||||
users_service=users)
|
||||
injections.KwArg('db', database),
|
||||
injections.KwArg('users_service', users))
|
||||
""":type: providers.Provider -> AuthService"""
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user