mirror of
https://github.com/ets-labs/python-dependency-injector.git
synced 2025-02-07 15:10:47 +03:00
1ad852d193
* Update index page * Update providers index page * Make a little wording fix on containers index page * Refactor factory provider docs header * Update factory injection docs * Update factory init injections example and picture * Start work on underlying providers * Finish the docs for factory arguments to the underlying providers * Edit providers delegation section * Edit section about specialized factory provider * Edit abstract factory section * Edit FactoryAggregate docs * Add meta keywords and description
16 lines
227 B
Python
16 lines
227 B
Python
"""`Factory` providers example."""
|
|
|
|
from dependency_injector import providers
|
|
|
|
|
|
class User:
|
|
...
|
|
|
|
|
|
users_factory = providers.Factory(User)
|
|
|
|
|
|
if __name__ == '__main__':
|
|
user1 = users_factory()
|
|
user2 = users_factory()
|