尝试跟随https://github.com/jazzband/django-model-utils/issues/186
#admin.py
class CompanyAdmin(admin.ModelAdmin):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.readonly_fields += (
"created",
"modified",
)错误
django_1 | SystemCheckError: System check identified some issues:
django_1 |
django_1 | ERRORS:
django_1 | <class 'meetings.admin.CompanyAdmin'>: (admin.E035) The value of 'readonly_fields[0]' is not a callable, an attribute of 'CompanyAdmin', or an attribute of 'meetings.Company'.
django_1 | <class 'meetings.admin.CompanyAdmin'>: (admin.E035) The value of 'readonly_fields[1]' is not a callable, an attribute of 'CompanyAdmin', or an attribute of 'meetings.Company'.如何使用django- created -utils在管理面板中显示模型值?
发布于 2021-01-17 22:49:22
根据错误,看起来created和modified不是模型(meetings.Company)的属性。
是否确定已将这些字段添加到Company模型中。
如果这不能解决你的问题,你能将你的模型添加到问题中吗?
https://stackoverflow.com/questions/65722637
复制相似问题