【问题标题】:Getting system check errors获取系统检查错误
【发布时间】:2016-10-01 16:55:21
【问题描述】:

我正在尝试为一个非常复杂的 Web 应用程序设置本地开发环境。没有设置环境的适当文档,所以这两天我自己解决了错误。解决所有错误后,我收到下面提到的系统检查错误,我不明白它们的含义?有人可以帮忙,这些错误是什么意思以及如何解决它们。

django.core.management.base.CommandError: System check identified some issues:

ERRORS:
<class 'credits.admin.creditshistoryAdmin'>: (admin.E035) The value of 'readonly_fields[29]' is not a callable, an attribute of 'creditshistoryAdmin', or an attribute of 'credits.CreditsHistory'.

<class 'credits.admin.creditshistoryAdmin'>: (admin.E035) The value of 'readonly_fields[30]' is not a callable, an attribute of 'creditshistoryAdmin', or an attribute of 'credits.CreditsHistory'.

【问题讨论】:

  • 显示你尝试过的管理代码

标签: python django django-models django-1.7


【解决方案1】:

credits.admin.creditshistoryAdmin 类有一个属性readonly_fields

这是在管理员中显示为只读的字段列表(请参阅ModelAdmin.readonly_fields 上的文档)。

该列表的项目应该是可调用的,或者是管理员 (creditshistoryAdmin) 或模型 (credits.CreditsHistory) 的属性。但是第 30 和第 31 位置的项目(所以 readonly_fields[29] 和 [30])是另一回事。

为了进一步诊断,您必须发布credits.admin.creditshistoryAdmincredits.models.CreditsHistory的代码。

【讨论】:

  • 请注意,在 readonly_fields 中至少有 30 个项目听起来首先是一个严重的可用性问题。
猜你喜欢
  • 2022-06-23
  • 1970-01-01
  • 2012-04-12
  • 2012-12-13
  • 2012-02-21
  • 1970-01-01
  • 1970-01-01
  • 2017-06-24
  • 1970-01-01
相关资源
最近更新 更多