Skip to content

Commit 7238482

Browse files
committed
Add .providers attribute and .set_providers() method to FactoryAggregate provider
1 parent 541131e commit 7238482

File tree

8 files changed

+4388
-4096
lines changed

8 files changed

+4388
-4096
lines changed

docs/main/changelog.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,14 @@ that were made in every particular version.
77
From version 0.7.6 *Dependency Injector* framework strictly
88
follows `Semantic versioning`_
99

10+
Development version
11+
-------------------
12+
- Add ``.providers`` attribute to the ``FactoryAggregate`` provider. It is an alias for
13+
``FactoryAggregate.factories`` attribute.
14+
- Add ``.set_providers()`` method to the ``FactoryAggregate`` provider. It is an alias for
15+
``FactoryAggregate.set_factories()`` method.
16+
- Refactor ``FactoryAggregate`` provider internals.
17+
1018
4.37.0
1119
------
1220
- Add support of Python 3.10.

docs/providers/factory.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -163,9 +163,9 @@ The aggregated factories are associated with the string keys. When you call the
163163
:lines: 3-
164164
:emphasize-lines: 33-37,47
165165

166-
You can get a dictionary of the aggregated factories using the ``.factories`` attribute.
167-
To get a game factories dictionary from the previous example you can use
168-
``game_factory.factories`` attribute.
166+
You can get a dictionary of the aggregated providers using ``.providers`` attribute.
167+
To get a game provider dictionary from the previous example you can use
168+
``game_factory.providers`` attribute.
169169

170170
You can also access an aggregated factory as an attribute. To create the ``Chess`` object from the
171171
previous example you can do ``chess = game_factory.chess("John", "Jane")``.
@@ -176,7 +176,7 @@ previous example you can do ``chess = game_factory.chess("John", "Jane")``.
176176
.. note::
177177
When you inject the ``FactoryAggregate`` provider it is passed "as is".
178178

179-
To use non-string keys or keys with ``.`` and ``-`` you can provide a dictionary as a positional argument:
179+
To use non-string keys or string keys with ``.`` and ``-``, you can provide a dictionary as a positional argument:
180180

181181
.. code-block:: python
182182

src/dependency_injector/containers.c

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)