You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
46 lines
939 B
Python
46 lines
939 B
Python
from peewee import *
|
|
|
|
database = Proxy()
|
|
|
|
|
|
class UnknownField(object):
|
|
def __init__(self, *_, **__): pass
|
|
|
|
|
|
class BaseModel(Model):
|
|
class Meta:
|
|
database = database
|
|
|
|
|
|
class CoronaDaten(BaseModel):
|
|
active = IntegerField(null=True)
|
|
confirmed = IntegerField(null=True)
|
|
country_region = TextField()
|
|
deaths = IntegerField(null=True)
|
|
quelle = TextField(null=True)
|
|
recoverd = IntegerField(null=True)
|
|
cases7_per_100k = FloatField(null=True)
|
|
ts = DateTimeField()
|
|
|
|
class Meta:
|
|
table_name = 'corona_daten'
|
|
indexes = (
|
|
(('ts', 'country_region'), True),
|
|
)
|
|
primary_key = CompositeKey('country_region', 'ts')
|
|
|
|
|
|
class CoronaStatistik(BaseModel):
|
|
ts = DateTimeField()
|
|
quelle = TextField()
|
|
country_region = TextField()
|
|
typ = TextField()
|
|
wert = FloatField()
|
|
|
|
|
|
def create_tables():
|
|
database.create_tables([CoronaDaten, CoronaStatistik])
|
|
|
|
|
|
|