mirror of
https://github.com/ets-labs/python-dependency-injector.git
synced 2025-02-07 15:10:47 +03:00
Updating example
This commit is contained in:
parent
4620ad7f29
commit
e38cecfae0
|
@ -2,6 +2,7 @@
|
||||||
|
|
||||||
from objects.providers import Factory
|
from objects.providers import Factory
|
||||||
from objects.providers import Singleton
|
from objects.providers import Singleton
|
||||||
|
from objects.providers import Delegate
|
||||||
|
|
||||||
from objects.injections import KwArg
|
from objects.injections import KwArg
|
||||||
|
|
||||||
|
@ -53,8 +54,7 @@ class UserService(object):
|
||||||
# Users factory and UserService provider:
|
# Users factory and UserService provider:
|
||||||
users_service = Singleton(UserService,
|
users_service = Singleton(UserService,
|
||||||
KwArg('users_factory',
|
KwArg('users_factory',
|
||||||
Factory(User),
|
Delegate(Factory(User))))
|
||||||
delegate=True))
|
|
||||||
|
|
||||||
|
|
||||||
# Creating several User objects:
|
# Creating several User objects:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user