models.py 612 B

1234567891011121314151617
  1. from django.contrib.auth.models import User
  2. from django.db import models
  3. # Create your models here.
  4. class DailyReport(models.Model):
  5. # 生成的所有字段
  6. title = models.CharField(max_length=50)
  7. content = models.TextField()
  8. # auto_now 自动得到当前时间
  9. creat_at = models.DateTimeField(auto_now=True)
  10. creat_by = models.ForeignKey(User, blank=True, null=True, on_delete=models.CASCADE)
  11. class Meta:
  12. app_label = 'workreport'
  13. db_table = 'workreport_daily'
  14. verbose_name = '工作汇报'
  15. verbose_name_plural = '工作汇报列表'