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