Replace database methods with peewee ORM #39
1 changed files with 4 additions and 1 deletions
|
@ -18,12 +18,15 @@ def get_database_connection():
|
||||||
return db
|
return db
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
database_proxy = DatabaseProxy()
|
||||||
database = get_database_connection()
|
database = get_database_connection()
|
||||||
|
database_proxy.initialize(database)
|
||||||
|
|
||||||
|
|
||||||
class BaseModel(Model):
|
class BaseModel(Model):
|
||||||
class Meta:
|
class Meta:
|
||||||
database = database
|
database = database_proxy
|
||||||
|
|
||||||
|
|
||||||
class Channel(BaseModel):
|
class Channel(BaseModel):
|
||||||
|
|
Loading…
Reference in a new issue