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):
"""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"""