Update basic factory example and docs

This commit is contained in:
Roman Mogilatov 2015-09-02 22:18:13 +03:00
parent 98c4ec71c1
commit f9b4652e74
3 changed files with 4 additions and 4 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.6 KiB

After

Width:  |  Height:  |  Size: 8.2 KiB

View File

@ -1,7 +1,7 @@
Factory providers
-----------------
``Factory`` provider creates new instance of specified class on every call.
``di.Factory`` provider creates new instance of specified class on every call.
Nothing could be better than brief example:

View File

@ -1,6 +1,6 @@
"""`Factory` providers example."""
"""`di.Factory` providers example."""
from dependency_injector.providers import Factory
import dependency_injector as di
class User(object):
@ -8,7 +8,7 @@ class User(object):
"""Example class User."""
# Factory provider creates new instance of specified class on every call.
users_factory = Factory(User)
users_factory = di.Factory(User)
# Creating several User objects:
user1 = users_factory()