models.py 687 B

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