models.py 738 B

12345678910111213141516171819202122
  1. from django.contrib.auth.models import User
  2. from django.db import models
  3. # Create your models here.
  4. from mptt.fields import TreeForeignKey
  5. from mptt.models import MPTTModel
  6. class Menu(MPTTModel):
  7. name = models.CharField(max_length=100)
  8. config = models.TextField()
  9. create_at = models.DateTimeField(auto_now_add=True)
  10. create_by = models.ForeignKey(User, blank=True, null=True, on_delete=models.CASCADE)
  11. parent = TreeForeignKey('self', blank=True, null=True, on_delete=models.CASCADE)
  12. code = models.CharField(max_length=100)
  13. class Meta:
  14. app_label = 'basic'
  15. db_table = 'basic_menu'
  16. verbose_name = '报表菜单'
  17. verbose_name_plural = '报表菜单列表'