Update move_lister example

This commit is contained in:
Roman Mogilatov 2016-04-05 00:18:15 +03:00
parent 5c23160632
commit e7f7b0693c
3 changed files with 7 additions and 6 deletions

View File

@ -21,7 +21,7 @@ from dependency_injector import injections
@catalogs.override(MoviesModule)
class MyMoviesModule(catalogs.DeclarativeCatalog):
"""Customized catalog of movies module components."""
"""Customized catalog of movies module component providers."""
movie_finder = providers.Factory(finders.CsvMovieFinder,
*MoviesModule.movie_finder.injections,

View File

@ -22,7 +22,7 @@ from dependency_injector import injections
class ApplicationModule(catalogs.DeclarativeCatalog):
"""Catalog of application components."""
"""Catalog of application component providers."""
database = providers.Singleton(sqlite3.connect,
MOVIES_DB_PATH)
@ -30,7 +30,7 @@ class ApplicationModule(catalogs.DeclarativeCatalog):
@catalogs.override(MoviesModule)
class MyMoviesModule(catalogs.DeclarativeCatalog):
"""Customized catalog of movies module components."""
"""Customized catalog of movies module component providers."""
movie_finder = providers.Factory(finders.SqliteMovieFinder,
*MoviesModule.movie_finder.injections,

View File

@ -1,8 +1,9 @@
"""Movies package.
Top-level package of movies library. This package contains catalog of movies
module components - ``MoviesModule``. It is recommended to use movies library
functionality by fetching required instances from ``MoviesModule`` providers.
module component providers - ``MoviesModule``. It is recommended to use movies
library functionality by fetching required instances from ``MoviesModule``
providers.
Each of ``MoviesModule`` providers could be overridden.
"""
@ -16,7 +17,7 @@ from . import models
class MoviesModule(catalogs.DeclarativeCatalog):
"""Catalog of movies module components."""
"""Catalog of movies module component providers."""
movie_model = providers.DelegatedFactory(models.Movie)