from django.contrib.auth.models import User from django.db import models # Create your models here. from mptt.fields import TreeForeignKey from mptt.models import MPTTModel class Menu(MPTTModel): name = models.CharField(max_length=100) config = models.TextField() create_at = models.DateTimeField(auto_now_add=True) create_by = models.ForeignKey(User, blank=True, null=True, on_delete=models.CASCADE) parent = TreeForeignKey('self', blank=True, null=True, on_delete=models.CASCADE) code = models.CharField(max_length=100) class Meta: app_label = 'basic' db_table = 'basic_menu' verbose_name = '报表菜单' verbose_name_plural = '报表菜单列表'