在我的admin.py中,我使用’active’和’country’进行过滤,这是使用我的SomethingAdmin类中的以下代码行完成的….
list_filter = ['active','countryid']
正如您所看到的,在我的管理列表视图中显示countryid并不漂亮,如何将其更改为更友好的名称,比如说’Country’?
谢谢.
更新:
下面似乎工作:
incentiveid = models.ForeignKey(Incentive,verbose_name="Incentive",null=True,db_column='incentiveID',blank=True)
最佳答案
正如Aamir所说,如果您在模型中的字段上定义标签,您应该会看到更具吸引力的过滤器选项:
@H_301_35@class MyModel(models.Model):
countryid = models.ForeignKey(Country,verbose_name="Country",db_column='countryID',blank=True)