device_gateway.py 920 B

1234567891011121314151617181920
  1. # -*- coding: utf-8 -*-
  2. """
  3. demeter database
  4. name:device_gateway.py
  5. author:rabin
  6. """
  7. from .__load__ import *
  8. class Device_gateway(Model):
  9. __table__ = 'device_gateway'
  10. __comment__ = '设备网关管理'
  11. id = Fields(type='uuid', primaryKey=True, comment='网关ID', uuid='farm_id')
  12. farm_id = Fields(type='int', default='setting.farm', comment='园区ID', match='not')
  13. name = Fields(type='varchar(50)', comment='网关名')
  14. hardware_id = Fields(type='bigint', comment='硬件id', match='number|硬件id必须是数字')
  15. pic = Fields(type='varchar(255)', comment='设备分布图纸')
  16. camera = Fields(type='varchar(500)', comment='摄像头实时流地址')
  17. stat = Fields(type='boolean', default='False', comment='是否显示趋势图')
  18. state = Fields(type='boolean', default='True', comment='数据存在状态')
  19. cdate = Fields(type='int', default='time', comment='创建时间')