File tree Expand file tree Collapse file tree 3 files changed +4
-4
lines changed
Expand file tree Collapse file tree 3 files changed +4
-4
lines changed Original file line number Diff line number Diff line change 11Factory providers
22-----------------
33
4- ``Factory `` provider creates new instance of specified class on every call.
4+ ``di. Factory `` provider creates new instance of specified class on every call.
55
66Nothing could be better than brief example:
77
Original file line number Diff line number Diff line change 1- """`Factory` providers example."""
1+ """`di. Factory` providers example."""
22
3- from dependency_injector . providers import Factory
3+ import dependency_injector as di
44
55
66class User (object ):
77
88 """Example class User."""
99
1010# Factory provider creates new instance of specified class on every call.
11- users_factory = Factory (User )
11+ users_factory = di . Factory (User )
1212
1313# Creating several User objects:
1414user1 = users_factory ()
You can’t perform that action at this time.
0 commit comments