origin_batch.py 1.0 KB

12345678910111213141516171819202122232425
  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3. """
  4. demeter database
  5. name:origin_batch.py
  6. author:rabin
  7. """
  8. from __load__ import *
  9. class Origin_batch(Model):
  10. __table__ = 'origin_batch'
  11. __comment__ = '溯源批次表'
  12. id = Fields(type='uuid', primaryKey=True, comment='批次ID', uuid='farm_id')
  13. farm_id = Fields(type='int', default='setting.farm', comment='园区ID', match='not')
  14. name = Fields(type='varchar(150)', comment='产品名')
  15. zzdate = Fields(type='int', comment='种植时间')
  16. csdate = Fields(type='int', comment='采收时间')
  17. devices = Fields(type='text', comment='设备id')
  18. land_id = Fields(type='uuid', comment='地块id')
  19. product_id = Fields(type='uuid', comment='产品id')
  20. device_camera_id = Fields(type='uuid', comment='摄像头设备id')
  21. amount = Fields(type='varchar(150)', comment='本批产量')
  22. number = Fields(type='varchar(32)', comment='批号')
  23. state = Fields(type='boolean', default='True', comment='数据存在状态')
  24. cdate = Fields(type='int', default='time', comment='创建时间')