models.py 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. from django.db import models
  2. # Create your models here.
  3. class BabyUser(models.Model):
  4. id = models.AutoField(primary_key=True, verbose_name='自增id')
  5. user_id = models.CharField(default='', max_length=32, verbose_name='关联用户id')
  6. nick_name = models.CharField(default='', max_length=20, verbose_name='昵称')
  7. sex = models.SmallIntegerField(default=0, verbose_name='性别') # 0:女 1:男
  8. birthday = models.IntegerField(default=0, verbose_name='生日')
  9. icon_url = models.TextField(default='', verbose_name='头像地址')
  10. device_id = models.CharField(default='', max_length=32, verbose_name='关联设备')
  11. is_default = models.BooleanField(default=False, verbose_name='是否默认')
  12. created_time = models.IntegerField(default=0, verbose_name='创建时间')
  13. updated_time = models.IntegerField(default=0, verbose_name='更新时间')
  14. class Meta:
  15. db_table = 'baby_user'
  16. verbose_name = '宝宝用户表'
  17. verbose_name_plural = verbose_name
  18. app_label = 'Roomumy'
  19. class FeedDiary(models.Model):
  20. id = models.AutoField(primary_key=True, verbose_name='自增id')
  21. baby_id = models.IntegerField(default=0, verbose_name='关联宝宝id')
  22. event_type = models.IntegerField(default=0, verbose_name='事件类型')
  23. # 1:母乳亲喂 2:母乳瓶喂 3:奶粉 4:辅食 5:换尿布 6:身高体重 7:户外活动 8:育儿日记 9:自定义
  24. event_content = models.JSONField(null=True, verbose_name='事件内容')
  25. created_time = models.IntegerField(default=0, verbose_name='创建时间')
  26. updated_time = models.IntegerField(default=0, verbose_name='更新时间')
  27. class Meta:
  28. db_table = 'feed_diary'
  29. verbose_name = '喂养日记表'
  30. verbose_name_plural = verbose_name
  31. app_label = 'Roomumy'