1234567891011121314151617181920 |
- from django.contrib.auth.models import User
- from django.db import models
- # 实体表,需要migrate
- class DailyReport(models.Model):
- # 标题字段,最长50
- title = models.CharField(max_length=50)
- # 文本字段
- content = models.TextField()
- # 创建时间,只有在创建的时候会自动填充当前时间
- create_at = models.DateField(auto_now_add=True)
- # 创建人,外键类型
- create_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 = '工作汇报列表'
|