Update concept example in README

This commit is contained in:
Roman Mogilatov 2015-12-11 11:39:47 +02:00
parent 7b35909083
commit 4285205dca

View File

@ -93,16 +93,17 @@ Examples
class Services(catalogs.DeclarativeCatalog): class Services(catalogs.DeclarativeCatalog):
"""Catalog of service providers.""" """Catalog of service providers."""
database = providers.Singleton(sqlite3.connect, ':memory:') database = providers.Singleton(sqlite3.connect,
injections.Arg(':memory:'))
""":type: providers.Provider -> sqlite3.Connection""" """:type: providers.Provider -> sqlite3.Connection"""
users = providers.Factory(UsersService, users = providers.Factory(UsersService,
db=database) injections.KwArg('db', database))
""":type: providers.Provider -> UsersService""" """:type: providers.Provider -> UsersService"""
auth = providers.Factory(AuthService, auth = providers.Factory(AuthService,
db=database, injections.KwArg('db', database),
users_service=users) injections.KwArg('users_service', users))
""":type: providers.Provider -> AuthService""" """:type: providers.Provider -> AuthService"""