From 9b30752da2936c2af8d0170781bcb7fea9b9819e Mon Sep 17 00:00:00 2001 From: Roman Mogylatov Date: Thu, 6 Aug 2020 16:42:31 -0400 Subject: [PATCH] Update docs --- docs/providers/factory.rst | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/docs/providers/factory.rst b/docs/providers/factory.rst index 86093384..2aa7f3ab 100644 --- a/docs/providers/factory.rst +++ b/docs/providers/factory.rst @@ -48,6 +48,21 @@ injectable values are also provided by another factories: .. literalinclude:: ../../examples/providers/factory_init_injections.py :language: python +Factory providers and building complex object graphs +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +You can use :py:class:`Factory` provider to build complex object graphs. + +Consider next example: + +.. literalinclude:: ../../examples/providers/factory_deep_init_injections.py + :language: python + +.. note:: + + You can use ``__`` separator in the name of the keyword argument to pass the value to the child + factory, e.g. ``algorithm_factory(task__loss__regularizer__alpha=0.5)``. + .. _factory_providers_delegation: Factory providers delegation