mirror of
https://github.com/koloideal/Argenta.git
synced 2026-06-10 10:05:28 +03:00
docs and fix
This commit is contained in:
@@ -18,19 +18,19 @@
|
||||
.. note::
|
||||
``argenta.di.FromDishka`` это алиас к ``dishka.FromDishka``, они полностью взаимозаменяемы.
|
||||
|
||||
.. literalinclude:: ../code_snippets/dependency_injection_example_sample.py
|
||||
.. literalinclude:: ../code_snippets/dependency_injection_snippet.py
|
||||
:language: python
|
||||
:linenos:
|
||||
|
||||
``Argenta`` -> ``dishka`` зарезолвит тайпхинты и внедрит зависимость с возвращаемым типом ``Connection``, прежде чем использовать зависимость её нужно создать, для этого нужно создать соответствующий провайдер.
|
||||
|
||||
.. literalinclude:: ../code_snippets/dependency_injection_example_sample2.py
|
||||
.. literalinclude:: ../code_snippets/dependency_injection_snippet2.py
|
||||
:language: python
|
||||
:linenos:
|
||||
|
||||
После создания провайдера, его нужно зарегистрировать в оркестраторе.
|
||||
|
||||
.. literalinclude:: ../code_snippets/dependency_injection_example_sample3.py
|
||||
.. literalinclude:: ../code_snippets/dependency_injection_snippet3.py
|
||||
:language: python
|
||||
:linenos:
|
||||
|
||||
@@ -49,7 +49,7 @@
|
||||
|
||||
Краткий сэмпл кода, который получает объект ``ArgSpace`` и выводит в консоль аргумент с именем "type":
|
||||
|
||||
.. literalinclude:: ../code_snippets/dependency_injection_example_sample4.py
|
||||
.. literalinclude:: ../code_snippets/dependency_injection_snippet4.py
|
||||
:language: python
|
||||
:linenos:
|
||||
|
||||
|
||||
Reference in New Issue
Block a user