mirror of
https://github.com/ets-labs/python-dependency-injector.git
synced 2025-01-31 03:36:41 +03:00
Update bundles example with Dependency provider
This commit is contained in:
parent
828a04de88
commit
1115e783e0
|
@ -1,7 +1,7 @@
|
|||
"""Photos bundle."""
|
||||
|
||||
from core import containers
|
||||
from core import providers
|
||||
from dependency_injector import providers
|
||||
|
||||
from . import entities
|
||||
from . import repositories
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
"""Users bundle."""
|
||||
|
||||
from core import containers
|
||||
from core import providers
|
||||
from dependency_injector import providers
|
||||
|
||||
from . import entities
|
||||
from . import repositories
|
||||
|
|
|
@ -2,9 +2,7 @@
|
|||
|
||||
import six
|
||||
|
||||
from dependency_injector import containers
|
||||
|
||||
from core import providers
|
||||
from dependency_injector import containers, providers
|
||||
|
||||
|
||||
class DeclarativeContainer(containers.DeclarativeContainer):
|
||||
|
|
|
@ -1,18 +0,0 @@
|
|||
"""Providers module."""
|
||||
|
||||
from dependency_injector import providers
|
||||
|
||||
|
||||
Factory = providers.Factory
|
||||
Singleton = providers.Singleton
|
||||
|
||||
|
||||
deepcopy = providers.deepcopy
|
||||
|
||||
|
||||
class Dependency(providers.ExternalDependency):
|
||||
"""Dependency provider."""
|
||||
|
||||
def __init__(self, type=object):
|
||||
"""Initializer."""
|
||||
super(Dependency, self).__init__(type)
|
|
@ -1,6 +1,7 @@
|
|||
"""Example application - Bundles."""
|
||||
|
||||
from core import containers, providers
|
||||
from core import containers
|
||||
from dependency_injector import providers
|
||||
|
||||
from bundles.users import Users
|
||||
from bundles.photos import Photos
|
||||
|
|
Loading…
Reference in New Issue
Block a user