在我的models.py中,这是我的类结构:
class Department_master(ModelWithoutAppName):
rec_id = models.AutoField(primary_key=True)
department_code = models.CharField(max_length=50)
department_name = models.CharField(max_length=50)
FALSE = '0'
TRUE = '1'
Status_choices = (
(TRUE, 'True'),
(FALSE, 'False'),
)
status=models.CharField(max_length=2,
choices=Status_choices,
default=TRUE)
def __unicode__(self):
return self.department_name
现在我已在Admin(admin.py)中通过以下方式注册此模型:
admin.site.register(Department_master)
现在,当我要去管理员查看详细信息时,首先显示:
Department_masters (the model class name)
当我点击Department_masters:
Department_master (the model class name)
Testing (added department_name in the table department_master as my __unicode__ returns self.department_name)
现在我想在目前的管理部分
中更改我的模型类名称Department_master to Department Master.
并且还希望不仅仅显示
department_name under Department_master
也
department_code by modifying __unicode__ return
有可能吗?