123456789101112131415161718192021 |
- from django.db import models
- from utils.models import BaseModel
- # Create your models here.
- class Bar(BaseModel):
- authName = models.CharField(max_length=200, default='', verbose_name="菜单名称")
- path = models.CharField(max_length=200, default='', verbose_name="跳转路径")
- partment = models.ForeignKey(to='self',null=True,on_delete=models.CASCADE,verbose_name="所属父类", related_name="children")
- icon = models.CharField(max_length=200, default='', verbose_name="图标")
- class Meta:
- db_table = 'django_bar'
- verbose_name = '菜单表'
- verbose_name_plural = verbose_name
- def __str__(self):
- return self.authName
- def __unicode__(self):
- return self.authName
|