mirror of
https://github.com/ets-labs/python-dependency-injector.git
synced 2024-11-25 19:14:00 +03:00
Update services miniapp example
This commit is contained in:
parent
88b563269d
commit
98ac4d902e
10
README.rst
10
README.rst
|
@ -99,13 +99,13 @@ defined above:
|
|||
|
||||
"""Dependency Injector @inject decorator example."""
|
||||
|
||||
import dependency_injector.injections as di
|
||||
import containers
|
||||
from dependency_injector.injections import inject
|
||||
from containers import Services
|
||||
|
||||
|
||||
@di.inject(users_service=containers.Services.users)
|
||||
@di.inject(auth_service=containers.Services.auth)
|
||||
@di.inject(photos_service=containers.Services.photos)
|
||||
@inject(users_service=Services.users)
|
||||
@inject(auth_service=Services.auth)
|
||||
@inject(photos_service=Services.photos)
|
||||
def main(users_service, auth_service, photos_service):
|
||||
"""Main function."""
|
||||
user = users_service.get_user('user')
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
"""Dependency Injector @inject decorator example."""
|
||||
|
||||
import dependency_injector.injections as di
|
||||
import containers
|
||||
from dependency_injector.injections import inject
|
||||
from containers import Services
|
||||
|
||||
|
||||
@di.inject(users_service=containers.Services.users)
|
||||
@di.inject(auth_service=containers.Services.auth)
|
||||
@di.inject(photos_service=containers.Services.photos)
|
||||
@inject(users_service=Services.users)
|
||||
@inject(auth_service=Services.auth)
|
||||
@inject(photos_service=Services.photos)
|
||||
def main(users_service, auth_service, photos_service):
|
||||
"""Main function."""
|
||||
user = users_service.get_user('user')
|
||||
|
|
Loading…
Reference in New Issue
Block a user