Update @di.inject examples comments

This commit is contained in:
Roman Mogilatov 2015-09-01 22:30:49 +03:00
parent 62df0bb853
commit e1fc8dde39
2 changed files with 1 additions and 4 deletions

View File

@ -5,18 +5,15 @@ import flask
import dependency_injector as di
# Database and `ObjectA` providers.
database = di.Singleton(sqlite3.Connection,
database=':memory:',
timeout=30,
detect_types=True,
isolation_level='EXCLUSIVE')
# Flask application:
app = flask.Flask(__name__)
# Flask view with @inject decorator:
@app.route('/')
@di.inject(database=database)
def hello(database):

View File

@ -9,7 +9,7 @@ dependency_injector_factory = di.Factory(object)
@di.inject(new_object=dependency_injector_factory)
@di.inject(some_setting=1334)
def example_callback(new_object, some_setting):
"""Example callback that does some asserts with input args."""
"""Example callback that does some asserts for input args."""
assert isinstance(new_object, object)
assert some_setting == 1334