models.py 1.9 KB

1234567891011121314151617181920212223242526
  1. from django.db import models
  2. class BaseModel(models.Model):
  3. create_time = models.DateTimeField(auto_now_add=True,verbose_name="创建时间")
  4. update_time = models.DateTimeField(auto_now=True,verbose_name="修改时间")
  5. create_user = models.CharField(max_length=50, verbose_name='创建人')
  6. update_user = models.CharField(max_length=50,default='', verbose_name='修改人')
  7. class Meta:
  8. abstract = True #表示用户被继承,不会迁移生成数据库所对应的具体的表
  9. class UtilsModel(BaseModel):
  10. component = models.CharField(max_length=100, null=False, blank=False, verbose_name='使用组件')
  11. status = models.BooleanField(default=True, verbose_name='状态')
  12. fontsize = models.IntegerField(default=0, verbose_name='字体大小')
  13. fontclass = models.CharField(max_length=30, default='', verbose_name='字体类型')
  14. fontbold = models.BooleanField(default=False, verbose_name='是否加粗')
  15. fontcolor = models.CharField(max_length=100, default='', verbose_name='字体颜色')
  16. backgroundcolor = models.CharField(max_length=100, default='', verbose_name='背景颜色')
  17. transparency = models.CharField(max_length=100, default='', verbose_name='元素透明度')
  18. goby = models.CharField(max_length=100, default='', verbose_name='鼠标移动上去效果')
  19. topborder = models.CharField(max_length=100, default='', verbose_name='上边框和颜色')
  20. bottomborder = models.CharField(max_length=100, default='', verbose_name='下边框和颜色')
  21. leftborder = models.CharField(max_length=100, default='', verbose_name='左边框和颜色')
  22. rightborder = models.CharField(max_length=100, default='', verbose_name='右边框和颜色')
  23. rem = models.TextField(default='', null=True, blank=True, verbose_name='备注')
  24. class Meta:
  25. abstract = True #表示用户被继承,不会迁移生成数据库所对应的具体的表