Update services miniapp example

This commit is contained in:
Roman Mogilatov 2016-06-03 17:35:55 +03:00
parent 88b563269d
commit 98ac4d902e
2 changed files with 10 additions and 10 deletions

View File

@ -99,13 +99,13 @@ defined above:
"""Dependency Injector @inject decorator example.""" """Dependency Injector @inject decorator example."""
import dependency_injector.injections as di from dependency_injector.injections import inject
import containers from containers import Services
@di.inject(users_service=containers.Services.users) @inject(users_service=Services.users)
@di.inject(auth_service=containers.Services.auth) @inject(auth_service=Services.auth)
@di.inject(photos_service=containers.Services.photos) @inject(photos_service=Services.photos)
def main(users_service, auth_service, photos_service): def main(users_service, auth_service, photos_service):
"""Main function.""" """Main function."""
user = users_service.get_user('user') user = users_service.get_user('user')

View File

@ -1,12 +1,12 @@
"""Dependency Injector @inject decorator example.""" """Dependency Injector @inject decorator example."""
import dependency_injector.injections as di from dependency_injector.injections import inject
import containers from containers import Services
@di.inject(users_service=containers.Services.users) @inject(users_service=Services.users)
@di.inject(auth_service=containers.Services.auth) @inject(auth_service=Services.auth)
@di.inject(photos_service=containers.Services.photos) @inject(photos_service=Services.photos)
def main(users_service, auth_service, photos_service): def main(users_service, auth_service, photos_service):
"""Main function.""" """Main function."""
user = users_service.get_user('user') user = users_service.get_user('user')