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.

45 lines
895 B
Python

5 years ago
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)
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()
5 years ago
def create_tables():
4 years ago
database.create_tables([CoronaDaten, CoronaStatistik])
5 years ago