#!/usr/bin/env python # -*- coding: utf-8 -*- """ demeter database name:device_info.py author:rabin """ from __load__ import * class Device_info(Base): __table__ = 'device_info' __comment__ = '设备管理' id = Fields(type='uuid', primaryKey=True, comment='设备ID', uuid='farm_id') farm_id = Fields(type='int', default='setting.farm', comment='园区ID', match='not') name = Fields(type='varchar(50)', comment='设备名') hardware_id = Fields(type='bigint', comment='硬件id') hardware_type = Fields(type='int', comment='硬件类型') hardware_station = Fields(type='smallint', comment='硬件所属站:1气象站、2温室、3土壤商情、4阀门灌溉') gateway_id = Fields(type='uuid', comment='网关id') type_id = Fields(type='int', comment='设备类型') num = Fields(type='int', default='0', comment='设备数据') show_num = Fields(type='varchar(100)', comment='设备数据计算之后的数值') status = Fields(type='boolean', default='False', comment='设备连接状态') state = Fields(type='boolean', default='True', comment='数据存在状态') cdate = Fields(type='int', default='time', comment='创建时间')