Files
lm_code/models/weex.py

36 lines
698 B
Python
Raw Normal View History

2025-10-13 10:20:23 +08:00
from peewee import *
from models import db
2025-10-13 16:40:08 +08:00
class Weex15(Model):
2025-10-13 10:20:23 +08:00
id = IntegerField(primary_key=True)
open = FloatField(null=True)
high = FloatField(null=True)
low = FloatField(null=True)
close = FloatField(null=True)
class Meta:
database = db
2025-10-13 16:40:08 +08:00
table_name = 'weex_15'
class Weex1(Model):
id = IntegerField(primary_key=True)
open = FloatField(null=True)
high = FloatField(null=True)
low = FloatField(null=True)
close = FloatField(null=True)
class Meta:
database = db
table_name = 'weex_1'
2025-10-13 10:20:23 +08:00
2025-10-13 11:22:02 +08:00
2025-10-13 10:20:23 +08:00
# 连接到数据库
db.connect()
# 创建表(如果表不存在)
2025-10-13 16:40:08 +08:00
db.create_tables([Weex15])
db.create_tables([Weex1])