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.

23 lines
379 B
Python

import peewee
database = peewee.Proxy()
class BaseModel(peewee.Model):
class Meta:
database = database
class TestPeewee(BaseModel):
ts = peewee.DateTimeField()
typ = peewee.TextField()
value = peewee.FloatField()
class Meta:
primary_key = peewee.CompositeKey('ts', 'typ')
def create_tables():
database.create_tables([TestPeewee])