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 Payment(models.Model): payment_type = models.CharField(max_length=100) price_type = models.CharField(max_length=100) item_type = models.CharField(max_length=100) index_type = models.CharField(max_length=100) index_price = models.IntegerField() year = models.CharField(max_length=4) month = models.CharField(max_length=2) class Meta: app_label = 'payment' db_table = 'pay' verbose_name = '支出报表' verbose_name_plural = '支出报表列表' 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 = '报表菜单列表'