Commit c8ebc791 authored by wanli's avatar wanli

update

parent 0f1c2144
'''
Author: your name
Date: 2021-04-14 14:12:18
LastEditTime: 2021-07-01 17:54:11
LastEditors: your name
Description: In User Settings Edit
FilePath: \evm-store\backend\model\device.py
'''
#!/usr/bin/env python #!/usr/bin/env python
# -*- coding: utf_8 -*- # -*- coding: utf_8 -*-
import uuid import uuid
from datetime import datetime from datetime import datetime
from pony.orm import PrimaryKey, Required, Optional, Set, LongStr, Json from pony.orm import PrimaryKey, Required, Optional, Set
from app import config from app import config
from . import fullStackDB from . import fullStackDB
......
''' '''
Author: your name Author: your name
Date: 2021-04-14 14:12:18 Date: 2021-04-14 14:12:18
LastEditTime: 2021-06-30 23:52:39 LastEditTime: 2021-07-01 17:55:08
LastEditors: Please set LastEditors LastEditors: Please set LastEditors
Description: In User Settings Edit Description: In User Settings Edit
FilePath: \evm-store\backend\model\monitor.py FilePath: \evm-store\backend\model\monitor.py
...@@ -136,6 +136,17 @@ class Image(Base): ...@@ -136,6 +136,17 @@ class Image(Base):
def to_dict(self): def to_dict(self):
return {c.name: getattr(self, c.name) for c in self.__table__.columns} return {c.name: getattr(self, c.name) for c in self.__table__.columns}
class Device(Base):
__tablename__ = 'monitor_system'
id = Column(Integer, primary_key=True, autoincrement=True)
watch = Column(Integer) # 手表ID
free_size = Column(Integer) # 单位:字节
timestamp = Column(DateTime(timezone=True), default=get_current_datetime, server_default=func.now(), onupdate=func.now())
def to_dict(self):
return {c.name: getattr(self, c.name) for c in self.__table__.columns}
Base.metadata.create_all(engine, checkfirst=True) Base.metadata.create_all(engine, checkfirst=True)
# engine是2.2中创建的连接 # engine是2.2中创建的连接
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment