mirror of
https://github.com/ets-labs/python-dependency-injector.git
synced 2025-05-23 05:56:19 +03:00
Update django example
This commit is contained in:
parent
8d0ff4dba0
commit
aa845d412e
|
@ -108,6 +108,6 @@ The output should be something like:
|
||||||
web/apps.py 7 0 100%
|
web/apps.py 7 0 100%
|
||||||
web/tests.py 28 0 100%
|
web/tests.py 28 0 100%
|
||||||
web/urls.py 3 0 100%
|
web/urls.py 3 0 100%
|
||||||
web/views.py 11 0 100%
|
web/views.py 12 0 100%
|
||||||
---------------------------------------------------
|
---------------------------------------------------
|
||||||
TOTAL 120 10 92%
|
TOTAL 121 10 92%
|
||||||
|
|
|
@ -4,12 +4,13 @@ from typing import List
|
||||||
|
|
||||||
from django.http import HttpRequest, HttpResponse
|
from django.http import HttpRequest, HttpResponse
|
||||||
from django.shortcuts import render
|
from django.shortcuts import render
|
||||||
from dependency_injector.wiring import Provide
|
from dependency_injector.wiring import inject, Provide
|
||||||
|
|
||||||
from githubnavigator.containers import Container
|
from githubnavigator.containers import Container
|
||||||
from githubnavigator.services import SearchService
|
from githubnavigator.services import SearchService
|
||||||
|
|
||||||
|
|
||||||
|
@inject
|
||||||
def index(
|
def index(
|
||||||
request: HttpRequest,
|
request: HttpRequest,
|
||||||
search_service: SearchService = Provide[Container.search_service],
|
search_service: SearchService = Provide[Container.search_service],
|
||||||
|
|
Loading…
Reference in New Issue
Block a user