mirror of
https://github.com/ets-labs/python-dependency-injector.git
synced 2025-01-31 03:36:41 +03:00
Update ExternalDependency provider example
This commit is contained in:
parent
444af2ab0e
commit
b866229efb
|
@ -1,4 +1,4 @@
|
||||||
"""`ExternalDependency` providers example."""
|
"""`di.ExternalDependency` providers example."""
|
||||||
|
|
||||||
import sqlite3
|
import sqlite3
|
||||||
import contextlib
|
import contextlib
|
||||||
|
@ -18,6 +18,7 @@ class UserService(object):
|
||||||
Database dependency need to be injected via init arg.
|
Database dependency need to be injected via init arg.
|
||||||
"""
|
"""
|
||||||
self.database = database
|
self.database = database
|
||||||
|
self.database.row_factory = sqlite3.dbapi2.Row
|
||||||
|
|
||||||
def init_database(self):
|
def init_database(self):
|
||||||
"""Initialize database, if it has not been initialized yet."""
|
"""Initialize database, if it has not been initialized yet."""
|
||||||
|
|
Loading…
Reference in New Issue
Block a user