修改APP的名称:
# coding:utf-8 from django.apps import AppConfig
import os default_app_config = 'repository.RepositoryConfig' VERBOSE_APP_NAME = u"报障系统" def get_current_app_name(_file):
return os.path.split(os.path.dirname(_file))[-1] class RepositoryConfig(AppConfig):
name = get_current_app_name(__file__)
verbose_name = VERBOSE_APP_NAME
修改表的名称:
class Permission2Action(models.Model):
p = models.ForeignKey(Permission,on_delete=models.CASCADE)
a = models.ForeignKey(Action,on_delete=models.CASCADE) class Meta:
verbose_name_plural = "权限表" def __str__(self):
return "{0}-{1}:-{2}?t={3}".format(self.p.caption,self.a.caption,self.p.url,self.a.code)