models.py 1.2 KB

123456789101112131415161718192021222324252627282930313233343536
  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 Payment(models.Model):
  7. payment_type = models.CharField(max_length=100)
  8. price_type = models.CharField(max_length=100)
  9. item_type = models.CharField(max_length=100)
  10. index_type = models.CharField(max_length=100)
  11. index_price = models.IntegerField()
  12. year = models.CharField(max_length=4)
  13. month = models.CharField(max_length=2)
  14. class Meta:
  15. app_label = 'payment'
  16. db_table = 'pay'
  17. verbose_name = '支出报表'
  18. verbose_name_plural = '支出报表列表'
  19. class Menu(MPTTModel):
  20. name = models.CharField(max_length=100)
  21. config = models.TextField()
  22. create_at = models.DateTimeField(auto_now_add=True)
  23. create_by = models.ForeignKey(User, blank=True, null=True, on_delete=models.CASCADE)
  24. parent = TreeForeignKey('self', blank=True, null=True, on_delete=models.CASCADE)
  25. code = models.CharField(max_length=100)
  26. class Meta:
  27. app_label = 'basic'
  28. db_table = 'basic_menu'
  29. verbose_name = '报表菜单'
  30. verbose_name_plural = '报表菜单列表'