mirror of
https://github.com/Findus23/se-simulator.git
synced 2024-09-11 06:33:48 +02:00
15 lines
271 B
Python
15 lines
271 B
Python
import __main__
|
|
from peewee import Model, MySQLDatabase
|
|
|
|
import config
|
|
|
|
if __main__.__file__ != "server.py":
|
|
db = MySQLDatabase("se-simulator", **config.db)
|
|
db.connect()
|
|
else:
|
|
from app import db
|
|
|
|
|
|
class BaseModel(Model):
|
|
class Meta:
|
|
database = db
|