1
0
Fork 0
mirror of https://github.com/Findus23/RadioStats.git synced 2024-09-19 16:03:48 +02:00
RadioStats/basemodel.py

16 lines
264 B
Python
Raw Normal View History

2018-02-07 13:47:48 +01:00
import __main__
2018-02-05 21:44:37 +01:00
from peewee import Model, MySQLDatabase
import config
2018-02-07 13:47:48 +01:00
if __main__.__file__ != "server.py":
db = MySQLDatabase("radio", **config.db)
db.connect()
else:
from app import db
2018-02-05 21:44:37 +01:00
class BaseModel(Model):
class Meta:
database = db